{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import math\n",
    "from keras.models import Sequential\n",
    "from keras.layers import Dense\n",
    "from keras.datasets import mnist\n",
    "from keras.layers import Input, Dense, Reshape, Flatten, Dropout\n",
    "from keras.layers import BatchNormalization, Activation, ZeroPadding2D\n",
    "from keras.layers.advanced_activations import LeakyReLU\n",
    "from keras.models import Sequential, Model\n",
    "from keras.optimizers import Adam\n",
    "from keras.wrappers.scikit_learn import KerasClassifier\n",
    "from keras.utils import np_utils\n",
    "from sklearn.model_selection import cross_val_score\n",
    "from sklearn.model_selection import cross_val_predict\n",
    "from sklearn.model_selection import KFold\n",
    "from sklearn.preprocessing import LabelEncoder\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.metrics import confusion_matrix\n",
    "from keras.optimizers import Adam\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def build_discriminator():\n",
    "    model = Sequential()\n",
    "    model.add(Dense(41, input_dim=41, activation='relu'))  # discriminator takes 41 values from our dataset\n",
    "    model.add(Dense(30, activation='relu'))\n",
    "    model.add(Dense(15, activation='relu'))\n",
    "    model.add(Dense(1, activation='sigmoid'))  # outputs 0 to 1, 1 being read and 0 being fake\n",
    "\n",
    "    # model.summary()\n",
    "\n",
    "    attack = Input(shape=(41,))\n",
    "    validity = model(attack)\n",
    "\n",
    "    return Model(attack, validity)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def build_generator(hidden1, hidden2, hidden3):\n",
    "    model = Sequential()\n",
    "    model.add(Dense(hidden1, input_dim=41))  # arbitrarily selected 100 for our input noise vector?\n",
    "    model.add(LeakyReLU(alpha=0.2))\n",
    "    model.add(BatchNormalization(momentum=0.8))\n",
    "    model.add(Dense(hidden2))\n",
    "    model.add(LeakyReLU(alpha=0.2))\n",
    "    model.add(BatchNormalization(momentum=0.8))\n",
    "    model.add(Dense(hidden3))\n",
    "    model.add(LeakyReLU(alpha=0.2))\n",
    "    model.add(BatchNormalization(momentum=0.8))\n",
    "    model.add(Dense(41, activation='relu'))  # outputs a generated vector of the same size as our data (41)\n",
    "\n",
    "    # model.summary()\n",
    "\n",
    "    noise = Input(shape=(41,))\n",
    "    attack = model(noise)\n",
    "    return Model(noise, attack)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def trainGAN(gen_hidden1, gen_hidden2, gen_hidden3):\n",
    "    batch_size = 256\n",
    "    epochs = 7000\n",
    "    optimizer = Adam(0.0002, 0.5)\n",
    "    \n",
    "    dataframe = pd.read_csv('satan.csv').sample(9000) # sample 100 data points randomly from the csv\n",
    "    \n",
    "    # apply \"le.fit_transform\" to every column (usually only works on 1 column)\n",
    "    le = LabelEncoder()\n",
    "    dataframe_encoded = dataframe.apply(le.fit_transform)\n",
    "    dataset = dataframe_encoded.values\n",
    "    \n",
    "    #to visually judge results\n",
    "    print(\"Real satan attacks:\")\n",
    "    print(dataset[:2])\n",
    "    \n",
    "    # Set X as our input data and Y as our label\n",
    "    X_train = dataset[:, 0:41].astype(float)\n",
    "    Y_train = dataset[:, 41]\n",
    "    \n",
    "    # labels for data. 1 for valid attacks, 0 for fake (generated) attacks\n",
    "    valid = np.ones((batch_size, 1))\n",
    "    fake = np.zeros((batch_size, 1))\n",
    "    \n",
    "    # build the discriminator portion\n",
    "    discriminator = build_discriminator();\n",
    "    discriminator.compile(loss='binary_crossentropy', optimizer=optimizer, metrics=['accuracy'])\n",
    "    \n",
    "    # build the generator portion\n",
    "    generator = build_generator(gen_hidden1, gen_hidden2, gen_hidden3)\n",
    "    \n",
    "    #input and output of our combined model\n",
    "    z = Input(shape=(41,))\n",
    "    attack = generator(z)\n",
    "    validity = discriminator(attack)\n",
    "    \n",
    "    # build combined model from generator and discriminator\n",
    "    combined = Model(z, validity)\n",
    "    combined.compile(loss='binary_crossentropy', optimizer=optimizer)\n",
    "    \n",
    "    #break condition for training (when diverging)\n",
    "    loss_increase_count = 0;\n",
    "    prev_g_loss = 0;\n",
    "    \n",
    "    for epoch in range(epochs):\n",
    "\n",
    "        # ---------------------\n",
    "        #  Train Discriminator\n",
    "        # ---------------------\n",
    "        \n",
    "        # selecting batch_size random attacks from our training data\n",
    "        idx = np.random.randint(0, X_train.shape[0], batch_size)\n",
    "        attacks = X_train[idx]\n",
    "        \n",
    "        # generate a matrix of noise vectors\n",
    "        noise = np.random.normal(0, 1, (batch_size, 41))\n",
    "        \n",
    "        # create an array of generated attacks\n",
    "        gen_attacks = generator.predict(noise)\n",
    "        \n",
    "        # loss functions, based on what metrics we specify at model compile time\n",
    "        d_loss_real = discriminator.train_on_batch(attacks, valid)\n",
    "        d_loss_fake = discriminator.train_on_batch(gen_attacks, fake)\n",
    "        d_loss = 0.5 * np.add(d_loss_real, d_loss_fake)\n",
    "        \n",
    "        # generator loss function\n",
    "        g_loss = combined.train_on_batch(noise, valid)\n",
    "        \n",
    "        if epoch % 100 == 0:\n",
    "            print(\"%d [D loss: %f, acc.: %.2f%%] [G loss: %f] [Loss change: %.3f, Loss increases: %.0f]\" % (epoch, d_loss[0], 100 * d_loss[1], g_loss, g_loss - prev_g_loss, loss_increase_count))\n",
    "        \n",
    "        # if our generator loss icreased this iteration, increment the counter by 1\n",
    "        if (g_loss - prev_g_loss) > 0:\n",
    "            loss_increase_count = loss_increase_count + 1\n",
    "        else: \n",
    "            loss_increase_count = 0  # otherwise, reset it to 0, we are still training effectively\n",
    "            \n",
    "        prev_g_loss = g_loss\n",
    "            \n",
    "        if loss_increase_count > 5:\n",
    "            print('Stoping on iteration: ', epoch)\n",
    "            break\n",
    "            \n",
    "        if epoch % 20 == 0:\n",
    "            f = open(\"GANresultsSatan.txt\", \"a\")\n",
    "            np.savetxt(\"GANresultsSatan.txt\", gen_attacks, fmt=\"%.0f\")\n",
    "            f.close()\n",
    "            \n",
    "    # peek at our results\n",
    "    results = np.loadtxt(\"GANresultsSatan.txt\")\n",
    "    print(\"Generated Satan attacks: \")\n",
    "    print(results[:2])\n",
    "        \n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataframe = pd.read_csv(\"kdd_dataset.csv\")\n",
    "dataframe = dataframe.sample(n=3000)\n",
    "\n",
    "le = LabelEncoder()\n",
    "dataframe_encoded = dataframe.apply(le.fit_transform)\n",
    "attack_labels = le.classes_\n",
    "num_of_classes = len(attack_labels)\n",
    "dataset = dataframe_encoded.values\n",
    "\n",
    "indices_of_satan = np.where(attack_labels == 'satan.')\n",
    "satan_index = indices_of_satan[0]\n",
    "\n",
    "X = dataset[0:3000,0:41].astype(float)\n",
    "Y = dataset[0:3000,41]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def baseline_model():\n",
    "    model = Sequential()\n",
    "    \n",
    "    inputs = 41\n",
    "    hidden_layer1 = 18\n",
    "    hidden_layer2 = 6\n",
    "    hidden_layer3 = 0\n",
    "    outputs = num_of_classes  #needs to be this variable in case we forget to sample. Could end up having 10 classes or 12, etc\n",
    "    \n",
    "    model.add(Dense(hidden_layer1, input_dim=inputs, activation='relu'))\n",
    "    if hidden_layer2 != 0:\n",
    "        model.add(Dense(hidden_layer2, activation='relu'))\n",
    "    if hidden_layer3 != 0:\n",
    "        model.add(Dense(hidden_layer3, activation='relu'))\n",
    "    model.add(Dense(outputs, activation='softmax'))\n",
    "    \n",
    "    model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])\n",
    "    return model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Attack type: back.     number predicted:  13\n",
      "Attack type: ipsweep.     number predicted:  6\n",
      "Attack type: land.     number predicted:  1\n",
      "Attack type: neptune.     number predicted:  626\n",
      "Attack type: nmap.     number predicted:  1\n",
      "Attack type: normal.     number predicted:  616\n",
      "Attack type: pod.     number predicted:  2\n",
      "Attack type: portsweep.     number predicted:  6\n",
      "Attack type: satan.     number predicted:  19\n",
      "Attack type: smurf.     number predicted:  1702\n",
      "Attack type: teardrop.     number predicted:  2\n",
      "Attack type: warezclient.     number predicted:  6\n",
      "[[  12    0    0    0    0    0    0    0    0    0    0    0]\n",
      " [   0    6    0    0    0    0    0    0    0    0    0    0]\n",
      " [   0    0    1    0    0    0    0    0    0    0    0    0]\n",
      " [   0    0    0  626    0    0    0    0    0    0    0    0]\n",
      " [   0    0    0    0    1    0    0    0    0    0    0    0]\n",
      " [   1    0    0    0    0  616    0    0    0    0    0    0]\n",
      " [   0    0    0    0    0    0    2    0    0    0    0    0]\n",
      " [   0    0    0    0    0    0    0    6    0    0    0    0]\n",
      " [   0    0    0    0    0    0    0    0   19    0    0    0]\n",
      " [   0    0    0    0    0    0    0    0    0 1702    0    0]\n",
      " [   0    0    0    0    0    0    0    0    0    0    2    0]\n",
      " [   0    0    0    0    0    0    0    0    0    0    0    6]]\n",
      "accuracy: 0.9996666666666667\n"
     ]
    }
   ],
   "source": [
    "estimator = KerasClassifier(build_fn=baseline_model, epochs=300, batch_size=10, verbose=0)\n",
    "\n",
    "estimator.fit(X, Y)\n",
    "y_pred = estimator.predict(X)\n",
    "\n",
    "predicted_as_label = attack_labels[y_pred]\n",
    "unique_labels = np.unique(predicted_as_label)\n",
    "\n",
    "for label in unique_labels:\n",
    "    print(\"Attack type: %s     number predicted:  %.0f\" % (label, len(np.where(predicted_as_label == label)[0])))\n",
    "\n",
    "cm = confusion_matrix(Y, y_pred)\n",
    "print(cm)\n",
    "print(\"accuracy: \" + str(np.trace(cm) / cm.sum()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Real satan attacks:\n",
      "[[  0   1  40   2   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   1   1   0   0   1   0 174   0   0  99   0\n",
      "    0  42   1  58   0   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 501   0   0   0   1   1   0   1   0 174   0   0  99   0\n",
      "    0   7   0  93   7   0]]\n",
      "0 [D loss: 0.364126, acc.: 62.89%] [G loss: 0.595235] [Loss change: 0.595, Loss increases: 0]\n",
      "100 [D loss: 0.662544, acc.: 50.78%] [G loss: 0.387241] [Loss change: 0.005, Loss increases: 0]\n",
      "200 [D loss: 0.684582, acc.: 50.00%] [G loss: 0.347171] [Loss change: -0.011, Loss increases: 0]\n",
      "300 [D loss: 0.662876, acc.: 50.20%] [G loss: 0.345793] [Loss change: -0.003, Loss increases: 0]\n",
      "400 [D loss: 0.688331, acc.: 50.20%] [G loss: 0.345598] [Loss change: -0.006, Loss increases: 0]\n",
      "500 [D loss: 0.651338, acc.: 50.00%] [G loss: 0.359861] [Loss change: 0.012, Loss increases: 0]\n",
      "600 [D loss: 0.663702, acc.: 50.00%] [G loss: 0.346483] [Loss change: -0.004, Loss increases: 4]\n",
      "700 [D loss: 0.642509, acc.: 50.00%] [G loss: 0.346574] [Loss change: -0.006, Loss increases: 1]\n",
      "800 [D loss: 0.648974, acc.: 50.20%] [G loss: 0.350396] [Loss change: 0.006, Loss increases: 0]\n",
      "900 [D loss: 0.648069, acc.: 50.00%] [G loss: 0.345057] [Loss change: -0.010, Loss increases: 0]\n",
      "1000 [D loss: 0.618497, acc.: 50.00%] [G loss: 0.368353] [Loss change: -0.000, Loss increases: 2]\n",
      "1100 [D loss: 0.600375, acc.: 50.00%] [G loss: 0.380779] [Loss change: -0.004, Loss increases: 3]\n",
      "1200 [D loss: 0.603849, acc.: 50.20%] [G loss: 0.383472] [Loss change: -0.007, Loss increases: 2]\n",
      "1300 [D loss: 0.584455, acc.: 50.00%] [G loss: 0.394691] [Loss change: -0.000, Loss increases: 1]\n",
      "Stoping on iteration:  1341\n",
      "Generated Satan attacks: \n",
      "[[ 5.  1.  0. 10.  0.  0.  0. 21.  2.  0.  0.  0.  0.  0.  0.  0.  0.  1.\n",
      "   0.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  9.  1.  0.  0.\n",
      "   0.  0. 25.  2. 16.]\n",
      " [ 0.  0.  0.  0.  8.  0.  6.  0.  0.  0.  0.  0.  0.  3.  8.  0.  0.  0.\n",
      "   0.  8.  0. 12.  0. 13.  0.  0.  0.  0.  0.  0.  0. 19.  0.  0. 23. 10.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  19\n",
      "Attack type: land.     number predicted:  1\n",
      "Attack type: neptune.     number predicted:  16\n",
      "Attack type: normal.     number predicted:  12\n",
      "Attack type: satan.     number predicted:  2\n",
      "Attack type: smurf.     number predicted:  147\n",
      "Attack type: teardrop.     number predicted:  59\n",
      "\n",
      "[[  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [ 19   1  16  12   2 147  59]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0078125\n",
      "Real satan attacks:\n",
      "[[  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 183   0   0  99   0\n",
      "    0   0   0 100   7   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 183   0   0  99   0\n",
      "    0   8   0  92   7   0]]\n",
      "0 [D loss: 0.546958, acc.: 56.45%] [G loss: 0.699182] [Loss change: 0.699, Loss increases: 0]\n",
      "100 [D loss: 0.677614, acc.: 50.78%] [G loss: 0.387999] [Loss change: 0.007, Loss increases: 0]\n",
      "200 [D loss: 0.738226, acc.: 50.39%] [G loss: 0.347131] [Loss change: 0.000, Loss increases: 1]\n",
      "300 [D loss: 0.744797, acc.: 51.17%] [G loss: 0.330165] [Loss change: 0.013, Loss increases: 0]\n",
      "400 [D loss: 0.742137, acc.: 50.78%] [G loss: 0.319716] [Loss change: 0.009, Loss increases: 1]\n",
      "500 [D loss: 0.764321, acc.: 50.78%] [G loss: 0.304762] [Loss change: -0.003, Loss increases: 0]\n",
      "600 [D loss: 0.771117, acc.: 50.20%] [G loss: 0.293742] [Loss change: -0.001, Loss increases: 1]\n",
      "700 [D loss: 0.769305, acc.: 50.00%] [G loss: 0.295466] [Loss change: -0.002, Loss increases: 0]\n",
      "800 [D loss: 0.760250, acc.: 50.39%] [G loss: 0.293025] [Loss change: 0.010, Loss increases: 0]\n",
      "900 [D loss: 0.766085, acc.: 50.00%] [G loss: 0.287048] [Loss change: -0.002, Loss increases: 0]\n",
      "1000 [D loss: 0.717283, acc.: 50.00%] [G loss: 0.309837] [Loss change: -0.004, Loss increases: 2]\n",
      "1100 [D loss: 0.734010, acc.: 50.00%] [G loss: 0.306432] [Loss change: -0.014, Loss increases: 1]\n",
      "1200 [D loss: 0.704734, acc.: 50.00%] [G loss: 0.335334] [Loss change: 0.001, Loss increases: 2]\n",
      "1300 [D loss: 0.696232, acc.: 50.20%] [G loss: 0.339012] [Loss change: 0.001, Loss increases: 0]\n",
      "1400 [D loss: 0.673389, acc.: 49.80%] [G loss: 0.358620] [Loss change: 0.006, Loss increases: 0]\n",
      "1500 [D loss: 0.656015, acc.: 50.20%] [G loss: 0.360203] [Loss change: -0.004, Loss increases: 0]\n",
      "1600 [D loss: 0.639909, acc.: 50.39%] [G loss: 0.381059] [Loss change: -0.002, Loss increases: 2]\n",
      "1700 [D loss: 0.644211, acc.: 49.80%] [G loss: 0.383584] [Loss change: -0.005, Loss increases: 3]\n",
      "1800 [D loss: 0.603591, acc.: 51.17%] [G loss: 0.401620] [Loss change: 0.005, Loss increases: 0]\n",
      "1900 [D loss: 0.588216, acc.: 51.17%] [G loss: 0.421232] [Loss change: 0.004, Loss increases: 0]\n",
      "2000 [D loss: 0.587610, acc.: 50.78%] [G loss: 0.428641] [Loss change: -0.002, Loss increases: 1]\n",
      "2100 [D loss: 0.583359, acc.: 50.59%] [G loss: 0.438776] [Loss change: 0.001, Loss increases: 0]\n",
      "2200 [D loss: 0.548662, acc.: 51.56%] [G loss: 0.457706] [Loss change: 0.003, Loss increases: 0]\n",
      "2300 [D loss: 0.524286, acc.: 51.37%] [G loss: 0.468075] [Loss change: -0.005, Loss increases: 1]\n",
      "2400 [D loss: 0.535972, acc.: 51.95%] [G loss: 0.484426] [Loss change: -0.005, Loss increases: 0]\n",
      "2500 [D loss: 0.528546, acc.: 52.54%] [G loss: 0.467833] [Loss change: -0.001, Loss increases: 0]\n",
      "2600 [D loss: 0.516208, acc.: 51.95%] [G loss: 0.467070] [Loss change: -0.005, Loss increases: 3]\n",
      "2700 [D loss: 0.497679, acc.: 51.56%] [G loss: 0.488630] [Loss change: -0.002, Loss increases: 2]\n",
      "Stoping on iteration:  2774\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0. 40.  0.  0.  0. 28.  0.  0.  0.  1.  8.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 29.  0.  0.  0.  0.  3.  0.  0.  0. 47.  1.  0.  1.  0.\n",
      "   0.  0.  4. 51.  0.]\n",
      " [ 0.  7.  0. 16.  0.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  6. 41.\n",
      "   0.  9.  0.  0.  0.  3.  0.  0.  4.  0.  0.  0.  0.  0.  0.  2.  1. 62.\n",
      "   0. 10.  0.  0. 10.]]\n",
      "Attack type: land.     number predicted:  3\n",
      "Attack type: neptune.     number predicted:  144\n",
      "Attack type: nmap.     number predicted:  77\n",
      "Attack type: portsweep.     number predicted:  31\n",
      "Attack type: teardrop.     number predicted:  1\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  3 144  77  31   0   1]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   1   1   0   0   1   0 172   0   0  99   0\n",
      "    0  30   1  70   0   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   0   1   1   0   1   0 172   0   0  99   0\n",
      "    0   2   0  98   8   0]]\n",
      "0 [D loss: 7.688595, acc.: 9.38%] [G loss: 0.648310] [Loss change: 0.648, Loss increases: 0]\n",
      "100 [D loss: 1.017616, acc.: 50.00%] [G loss: 0.199983] [Loss change: -0.003, Loss increases: 0]\n",
      "200 [D loss: 1.459687, acc.: 50.20%] [G loss: 0.106008] [Loss change: 0.000, Loss increases: 2]\n",
      "300 [D loss: 1.825280, acc.: 49.80%] [G loss: 0.050519] [Loss change: -0.005, Loss increases: 1]\n",
      "400 [D loss: 1.982686, acc.: 49.22%] [G loss: 0.037448] [Loss change: -0.010, Loss increases: 2]\n",
      "500 [D loss: 2.001966, acc.: 50.00%] [G loss: 0.039495] [Loss change: 0.006, Loss increases: 0]\n",
      "600 [D loss: 1.851201, acc.: 49.80%] [G loss: 0.043474] [Loss change: 0.004, Loss increases: 1]\n",
      "700 [D loss: 1.805494, acc.: 50.00%] [G loss: 0.040365] [Loss change: -0.005, Loss increases: 2]\n",
      "800 [D loss: 1.800033, acc.: 50.00%] [G loss: 0.040676] [Loss change: -0.003, Loss increases: 0]\n",
      "900 [D loss: 1.793743, acc.: 50.00%] [G loss: 0.046440] [Loss change: 0.006, Loss increases: 0]\n",
      "1000 [D loss: 1.742569, acc.: 50.00%] [G loss: 0.044125] [Loss change: -0.006, Loss increases: 3]\n",
      "1100 [D loss: 1.725095, acc.: 50.00%] [G loss: 0.044964] [Loss change: -0.003, Loss increases: 1]\n",
      "1200 [D loss: 1.715321, acc.: 50.00%] [G loss: 0.048527] [Loss change: 0.002, Loss increases: 0]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1300 [D loss: 1.684733, acc.: 50.00%] [G loss: 0.056058] [Loss change: 0.006, Loss increases: 1]\n",
      "1400 [D loss: 1.688379, acc.: 50.00%] [G loss: 0.048465] [Loss change: -0.003, Loss increases: 0]\n",
      "1500 [D loss: 1.649527, acc.: 50.00%] [G loss: 0.057230] [Loss change: -0.001, Loss increases: 2]\n",
      "1600 [D loss: 1.637195, acc.: 50.00%] [G loss: 0.061201] [Loss change: 0.003, Loss increases: 0]\n",
      "1700 [D loss: 1.643798, acc.: 50.00%] [G loss: 0.059936] [Loss change: -0.004, Loss increases: 1]\n",
      "1800 [D loss: 1.645630, acc.: 50.00%] [G loss: 0.067947] [Loss change: -0.006, Loss increases: 1]\n",
      "1900 [D loss: 1.634091, acc.: 50.00%] [G loss: 0.083312] [Loss change: 0.015, Loss increases: 0]\n",
      "2000 [D loss: 1.615365, acc.: 50.00%] [G loss: 0.075695] [Loss change: 0.005, Loss increases: 0]\n",
      "2100 [D loss: 1.646853, acc.: 50.00%] [G loss: 0.074213] [Loss change: -0.002, Loss increases: 0]\n",
      "2200 [D loss: 1.607213, acc.: 50.00%] [G loss: 0.075483] [Loss change: -0.006, Loss increases: 1]\n",
      "2300 [D loss: 1.598731, acc.: 50.00%] [G loss: 0.079434] [Loss change: -0.004, Loss increases: 0]\n",
      "2400 [D loss: 1.575732, acc.: 50.00%] [G loss: 0.082891] [Loss change: -0.012, Loss increases: 0]\n",
      "2500 [D loss: 1.727988, acc.: 50.00%] [G loss: 0.083171] [Loss change: -0.012, Loss increases: 1]\n",
      "2600 [D loss: 1.630046, acc.: 50.00%] [G loss: 0.089713] [Loss change: -0.001, Loss increases: 0]\n",
      "2700 [D loss: 1.592284, acc.: 50.00%] [G loss: 0.103719] [Loss change: 0.016, Loss increases: 0]\n",
      "2800 [D loss: 1.590022, acc.: 50.00%] [G loss: 0.109740] [Loss change: -0.004, Loss increases: 1]\n",
      "2900 [D loss: 1.543372, acc.: 50.00%] [G loss: 0.113576] [Loss change: 0.002, Loss increases: 0]\n",
      "3000 [D loss: 1.694636, acc.: 50.00%] [G loss: 0.108163] [Loss change: 0.008, Loss increases: 0]\n",
      "3100 [D loss: 1.676530, acc.: 50.00%] [G loss: 0.105066] [Loss change: -0.013, Loss increases: 0]\n",
      "3200 [D loss: 1.676842, acc.: 50.00%] [G loss: 0.119841] [Loss change: 0.001, Loss increases: 1]\n",
      "3300 [D loss: 1.625220, acc.: 49.02%] [G loss: 0.119079] [Loss change: -0.001, Loss increases: 3]\n",
      "3400 [D loss: 1.703557, acc.: 48.63%] [G loss: 0.105736] [Loss change: -0.002, Loss increases: 1]\n",
      "3500 [D loss: 1.634738, acc.: 49.02%] [G loss: 0.098054] [Loss change: -0.004, Loss increases: 0]\n",
      "3600 [D loss: 1.532668, acc.: 48.83%] [G loss: 0.110415] [Loss change: 0.007, Loss increases: 0]\n",
      "3700 [D loss: 1.573714, acc.: 49.02%] [G loss: 0.119774] [Loss change: -0.000, Loss increases: 3]\n",
      "3800 [D loss: 1.581245, acc.: 48.83%] [G loss: 0.125421] [Loss change: 0.017, Loss increases: 0]\n",
      "3900 [D loss: 1.611019, acc.: 49.22%] [G loss: 0.130427] [Loss change: 0.002, Loss increases: 2]\n",
      "4000 [D loss: 1.568735, acc.: 49.80%] [G loss: 0.134448] [Loss change: -0.007, Loss increases: 1]\n",
      "4100 [D loss: 1.493618, acc.: 49.80%] [G loss: 0.149108] [Loss change: 0.007, Loss increases: 2]\n",
      "4200 [D loss: 1.500753, acc.: 50.00%] [G loss: 0.129485] [Loss change: -0.032, Loss increases: 1]\n",
      "4300 [D loss: 1.393936, acc.: 49.80%] [G loss: 0.174857] [Loss change: 0.010, Loss increases: 2]\n",
      "4400 [D loss: 1.469839, acc.: 49.80%] [G loss: 0.173831] [Loss change: -0.007, Loss increases: 1]\n",
      "4500 [D loss: 1.417638, acc.: 50.00%] [G loss: 0.176706] [Loss change: 0.009, Loss increases: 0]\n",
      "4600 [D loss: 1.454000, acc.: 50.00%] [G loss: 0.181814] [Loss change: -0.007, Loss increases: 0]\n",
      "4700 [D loss: 1.410569, acc.: 50.00%] [G loss: 0.199303] [Loss change: -0.003, Loss increases: 2]\n",
      "4800 [D loss: 1.403001, acc.: 50.00%] [G loss: 0.192237] [Loss change: 0.016, Loss increases: 0]\n",
      "4900 [D loss: 1.351381, acc.: 50.00%] [G loss: 0.216150] [Loss change: 0.006, Loss increases: 2]\n",
      "5000 [D loss: 1.379889, acc.: 50.00%] [G loss: 0.234482] [Loss change: -0.006, Loss increases: 1]\n",
      "5100 [D loss: 1.321646, acc.: 50.00%] [G loss: 0.274640] [Loss change: 0.025, Loss increases: 1]\n",
      "5200 [D loss: 1.316714, acc.: 50.00%] [G loss: 0.243058] [Loss change: -0.043, Loss increases: 1]\n",
      "5300 [D loss: 1.288736, acc.: 50.00%] [G loss: 0.280070] [Loss change: 0.008, Loss increases: 1]\n",
      "5400 [D loss: 1.278044, acc.: 50.00%] [G loss: 0.297460] [Loss change: -0.029, Loss increases: 1]\n",
      "5500 [D loss: 1.337924, acc.: 50.00%] [G loss: 0.297172] [Loss change: -0.049, Loss increases: 0]\n",
      "5600 [D loss: 1.370290, acc.: 50.00%] [G loss: 0.320767] [Loss change: 0.021, Loss increases: 0]\n",
      "5700 [D loss: 1.499747, acc.: 50.00%] [G loss: 0.262261] [Loss change: 0.024, Loss increases: 0]\n",
      "5800 [D loss: 1.299954, acc.: 49.80%] [G loss: 0.280008] [Loss change: 0.002, Loss increases: 0]\n",
      "5900 [D loss: 1.139449, acc.: 49.61%] [G loss: 0.297285] [Loss change: -0.036, Loss increases: 0]\n",
      "6000 [D loss: 1.088348, acc.: 49.80%] [G loss: 0.494277] [Loss change: 0.150, Loss increases: 0]\n",
      "6100 [D loss: 0.996160, acc.: 49.80%] [G loss: 0.415115] [Loss change: 0.045, Loss increases: 0]\n",
      "6200 [D loss: 0.981047, acc.: 49.41%] [G loss: 0.378412] [Loss change: -0.035, Loss increases: 2]\n",
      "6300 [D loss: 0.960848, acc.: 49.80%] [G loss: 0.433374] [Loss change: 0.025, Loss increases: 2]\n",
      "6400 [D loss: 0.928255, acc.: 49.80%] [G loss: 0.431399] [Loss change: 0.017, Loss increases: 0]\n",
      "6500 [D loss: 0.961310, acc.: 49.41%] [G loss: 0.457251] [Loss change: 0.014, Loss increases: 0]\n",
      "6600 [D loss: 0.936401, acc.: 50.00%] [G loss: 0.536741] [Loss change: 0.087, Loss increases: 0]\n",
      "6700 [D loss: 0.914061, acc.: 49.80%] [G loss: 0.525491] [Loss change: -0.011, Loss increases: 1]\n",
      "6800 [D loss: 0.887783, acc.: 49.80%] [G loss: 0.528731] [Loss change: -0.033, Loss increases: 1]\n",
      "6900 [D loss: 0.886675, acc.: 50.00%] [G loss: 0.537333] [Loss change: -0.020, Loss increases: 0]\n",
      "Generated Satan attacks: \n",
      "[[  0.   2.  13.   0.   0.  14.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0.   0.   0.   0.   0.   0.  17.   9.   0.   0.   0.   0.\n",
      "    0.   0.   0.  56.   0.   0.   5.   0.   0.   0.   0.   7.   0.]\n",
      " [  0.   0.   0.   0.   0.  67.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0.   0.   0.   0.   0.   0.  19.   5.   0.   0.  13.   0.\n",
      "    0.   0.   5. 111.  13.   0.   0.   0.   0.   4.   0.  38.   0.]]\n",
      "Attack type: neptune.     number predicted:  165\n",
      "Attack type: normal.     number predicted:  47\n",
      "Attack type: smurf.     number predicted:  43\n",
      "Attack type: teardrop.     number predicted:  1\n",
      "\n",
      "[[  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [165  47   0  43   1]\n",
      " [  0   0   0   0   0]\n",
      " [  0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  45   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 501   0   0   0   1   1   0   1   0 175   0   0  99   0\n",
      "    0  14   0  84   7   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 499   0   0   0   1   1   0   1   0 175   0   0  99   0\n",
      "    0  12   0  88   7   0]]\n",
      "0 [D loss: 0.361771, acc.: 69.53%] [G loss: 0.561718] [Loss change: 0.562, Loss increases: 0]\n",
      "100 [D loss: 0.636878, acc.: 50.00%] [G loss: 0.371059] [Loss change: 0.011, Loss increases: 0]\n",
      "200 [D loss: 0.673066, acc.: 50.00%] [G loss: 0.345766] [Loss change: -0.004, Loss increases: 1]\n",
      "300 [D loss: 0.704371, acc.: 50.20%] [G loss: 0.336684] [Loss change: -0.007, Loss increases: 1]\n",
      "400 [D loss: 0.681707, acc.: 50.00%] [G loss: 0.341322] [Loss change: -0.006, Loss increases: 1]\n",
      "500 [D loss: 0.669064, acc.: 50.20%] [G loss: 0.350176] [Loss change: -0.003, Loss increases: 1]\n",
      "600 [D loss: 0.653383, acc.: 50.00%] [G loss: 0.352224] [Loss change: -0.005, Loss increases: 0]\n",
      "700 [D loss: 0.636014, acc.: 50.39%] [G loss: 0.365925] [Loss change: 0.003, Loss increases: 1]\n",
      "800 [D loss: 0.639064, acc.: 50.20%] [G loss: 0.370276] [Loss change: -0.004, Loss increases: 0]\n",
      "900 [D loss: 0.644595, acc.: 50.39%] [G loss: 0.377771] [Loss change: -0.004, Loss increases: 1]\n",
      "Stoping on iteration:  999\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0. 12.  7.  0.  3.  0. 20. 22.  0.  0.  0.  0.  0.  2.  0.  0.  0.\n",
      "  25.  0.  0.  0. 23.  0. 38.  0.  0.  0.  0.  1.  0. 13.  0.  0. 11.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 1.  5.  0.  0.  7.  0.  0.  0.  0.  6.  1.  0.  1.  1.  0.  0.  6.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0. 24. 15.  0. 18.  0.  4.  0.  3.  9.  0. 16.\n",
      "  15.  0.  0.  9.  0.]]\n",
      "Attack type: land.     number predicted:  1\n",
      "Attack type: neptune.     number predicted:  56\n",
      "Attack type: nmap.     number predicted:  3\n",
      "Attack type: normal.     number predicted:  70\n",
      "Attack type: portsweep.     number predicted:  65\n",
      "Attack type: smurf.     number predicted:  32\n",
      "Attack type: warezclient.     number predicted:  29\n",
      "\n",
      "[[ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 1 56  3 70 65  0 32 29]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 168   0   0  99   0\n",
      "    0  18   0  82   7   0]\n",
      " [  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 168   0   0  99   1\n",
      "    0  36   0  64   7   0]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 [D loss: 0.390617, acc.: 50.00%] [G loss: 0.524029] [Loss change: 0.524, Loss increases: 0]\n",
      "100 [D loss: 0.745132, acc.: 50.00%] [G loss: 0.339261] [Loss change: -0.004, Loss increases: 2]\n",
      "200 [D loss: 0.732359, acc.: 50.20%] [G loss: 0.312758] [Loss change: -0.005, Loss increases: 0]\n",
      "300 [D loss: 0.748618, acc.: 50.00%] [G loss: 0.310026] [Loss change: 0.007, Loss increases: 0]\n",
      "400 [D loss: 0.741139, acc.: 50.20%] [G loss: 0.312845] [Loss change: 0.004, Loss increases: 0]\n",
      "500 [D loss: 0.725130, acc.: 50.39%] [G loss: 0.305736] [Loss change: 0.001, Loss increases: 1]\n",
      "600 [D loss: 0.694580, acc.: 50.39%] [G loss: 0.316786] [Loss change: 0.007, Loss increases: 1]\n",
      "700 [D loss: 0.699071, acc.: 50.20%] [G loss: 0.321138] [Loss change: 0.009, Loss increases: 0]\n",
      "800 [D loss: 0.719193, acc.: 50.20%] [G loss: 0.320886] [Loss change: 0.002, Loss increases: 1]\n",
      "900 [D loss: 0.687155, acc.: 50.59%] [G loss: 0.338483] [Loss change: 0.007, Loss increases: 0]\n",
      "1000 [D loss: 0.676906, acc.: 50.39%] [G loss: 0.344290] [Loss change: -0.003, Loss increases: 1]\n",
      "Stoping on iteration:  1086\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0. 12.  0.  0.  3.  0.  4.  0. 27.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  2.  0.  1.  0. 20.  0.  0.  0. 18. 15.  0.  0. 17.  0.  0. 13. 30.\n",
      "   0.  0.  6.  0.  0.]\n",
      " [12.  0.  0.  4. 15.  0.  0.  2.  0.  0. 13.  1.  0.  0.  0.  0.  0.  0.\n",
      "   0.  1.  0.  0.  2. 15. 25.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   9.  0.  0.  0.  9.]]\n",
      "Attack type: neptune.     number predicted:  18\n",
      "Attack type: nmap.     number predicted:  2\n",
      "Attack type: normal.     number predicted:  110\n",
      "Attack type: smurf.     number predicted:  102\n",
      "Attack type: teardrop.     number predicted:  2\n",
      "Attack type: warezclient.     number predicted:  22\n",
      "\n",
      "[[  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [ 18   2 110   0 102   2  22]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 177   0   0  99   0\n",
      "    0   5   0  95   8   0]\n",
      " [  0   2  47   6   1   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   5   5   0   0   0   0   1   0   0   9   5   8   6  12\n",
      "    0   0   0   0   0   0]]\n",
      "0 [D loss: 1.831852, acc.: 51.76%] [G loss: 0.860069] [Loss change: 0.860, Loss increases: 0]\n",
      "100 [D loss: 1.153624, acc.: 50.20%] [G loss: 0.175857] [Loss change: -0.010, Loss increases: 2]\n",
      "200 [D loss: 1.569493, acc.: 50.20%] [G loss: 0.098197] [Loss change: 0.004, Loss increases: 0]\n",
      "300 [D loss: 1.982152, acc.: 50.00%] [G loss: 0.046803] [Loss change: -0.013, Loss increases: 3]\n",
      "400 [D loss: 2.093908, acc.: 49.61%] [G loss: 0.044769] [Loss change: -0.009, Loss increases: 1]\n",
      "500 [D loss: 2.188625, acc.: 49.41%] [G loss: 0.046771] [Loss change: 0.001, Loss increases: 1]\n",
      "600 [D loss: 2.238688, acc.: 49.02%] [G loss: 0.032661] [Loss change: -0.019, Loss increases: 3]\n",
      "700 [D loss: 2.154515, acc.: 50.00%] [G loss: 0.040365] [Loss change: 0.002, Loss increases: 0]\n",
      "800 [D loss: 2.198593, acc.: 49.80%] [G loss: 0.044832] [Loss change: -0.001, Loss increases: 3]\n",
      "900 [D loss: 2.203781, acc.: 49.41%] [G loss: 0.044312] [Loss change: -0.000, Loss increases: 1]\n",
      "1000 [D loss: 2.141946, acc.: 49.41%] [G loss: 0.040158] [Loss change: -0.001, Loss increases: 1]\n",
      "1100 [D loss: 2.031921, acc.: 49.61%] [G loss: 0.043178] [Loss change: -0.006, Loss increases: 3]\n",
      "1200 [D loss: 2.100642, acc.: 49.41%] [G loss: 0.039382] [Loss change: -0.002, Loss increases: 0]\n",
      "1300 [D loss: 1.927269, acc.: 49.61%] [G loss: 0.057064] [Loss change: 0.010, Loss increases: 0]\n",
      "1400 [D loss: 1.911174, acc.: 49.61%] [G loss: 0.057310] [Loss change: 0.008, Loss increases: 0]\n",
      "1500 [D loss: 1.852070, acc.: 48.83%] [G loss: 0.057977] [Loss change: -0.002, Loss increases: 0]\n",
      "1600 [D loss: 1.981392, acc.: 48.63%] [G loss: 0.048855] [Loss change: -0.006, Loss increases: 0]\n",
      "1700 [D loss: 1.813293, acc.: 49.80%] [G loss: 0.057761] [Loss change: -0.002, Loss increases: 1]\n",
      "1800 [D loss: 1.843718, acc.: 49.61%] [G loss: 0.063223] [Loss change: 0.003, Loss increases: 2]\n",
      "1900 [D loss: 1.828942, acc.: 49.41%] [G loss: 0.070891] [Loss change: 0.014, Loss increases: 0]\n",
      "2000 [D loss: 1.789731, acc.: 49.41%] [G loss: 0.072642] [Loss change: -0.002, Loss increases: 2]\n",
      "2100 [D loss: 1.736915, acc.: 49.80%] [G loss: 0.075205] [Loss change: 0.007, Loss increases: 0]\n",
      "2200 [D loss: 1.739612, acc.: 50.00%] [G loss: 0.076418] [Loss change: 0.005, Loss increases: 0]\n",
      "2300 [D loss: 1.732193, acc.: 49.80%] [G loss: 0.070821] [Loss change: 0.003, Loss increases: 0]\n",
      "2400 [D loss: 1.735616, acc.: 50.00%] [G loss: 0.074822] [Loss change: 0.000, Loss increases: 0]\n",
      "2500 [D loss: 1.723165, acc.: 49.41%] [G loss: 0.085125] [Loss change: -0.003, Loss increases: 1]\n",
      "2600 [D loss: 1.691538, acc.: 49.41%] [G loss: 0.081487] [Loss change: -0.006, Loss increases: 1]\n",
      "2700 [D loss: 1.657297, acc.: 49.61%] [G loss: 0.086029] [Loss change: 0.007, Loss increases: 0]\n",
      "2800 [D loss: 1.592550, acc.: 49.80%] [G loss: 0.095831] [Loss change: 0.006, Loss increases: 0]\n",
      "2900 [D loss: 1.626995, acc.: 50.00%] [G loss: 0.092744] [Loss change: -0.008, Loss increases: 1]\n",
      "3000 [D loss: 1.620763, acc.: 49.61%] [G loss: 0.098793] [Loss change: 0.004, Loss increases: 0]\n",
      "3100 [D loss: 1.673532, acc.: 49.80%] [G loss: 0.107609] [Loss change: 0.004, Loss increases: 0]\n",
      "3200 [D loss: 1.719194, acc.: 49.61%] [G loss: 0.108346] [Loss change: -0.000, Loss increases: 3]\n",
      "3300 [D loss: 1.835086, acc.: 49.22%] [G loss: 0.107765] [Loss change: 0.007, Loss increases: 0]\n",
      "3400 [D loss: 1.807613, acc.: 50.00%] [G loss: 0.106113] [Loss change: -0.020, Loss increases: 3]\n",
      "3500 [D loss: 1.828062, acc.: 49.02%] [G loss: 0.108350] [Loss change: -0.009, Loss increases: 2]\n",
      "3600 [D loss: 1.794390, acc.: 50.00%] [G loss: 0.137217] [Loss change: 0.025, Loss increases: 0]\n",
      "3700 [D loss: 1.840217, acc.: 49.61%] [G loss: 0.134682] [Loss change: 0.009, Loss increases: 0]\n",
      "3800 [D loss: 1.794279, acc.: 49.61%] [G loss: 0.145661] [Loss change: 0.011, Loss increases: 0]\n",
      "3900 [D loss: 1.813756, acc.: 49.41%] [G loss: 0.147245] [Loss change: -0.007, Loss increases: 3]\n",
      "4000 [D loss: 1.810408, acc.: 49.61%] [G loss: 0.155029] [Loss change: -0.005, Loss increases: 1]\n",
      "4100 [D loss: 1.824523, acc.: 49.22%] [G loss: 0.145142] [Loss change: -0.022, Loss increases: 0]\n",
      "4200 [D loss: 1.728572, acc.: 49.02%] [G loss: 0.167829] [Loss change: 0.007, Loss increases: 0]\n",
      "4300 [D loss: 1.673859, acc.: 49.41%] [G loss: 0.184349] [Loss change: -0.003, Loss increases: 1]\n",
      "4400 [D loss: 1.652999, acc.: 49.22%] [G loss: 0.172982] [Loss change: -0.016, Loss increases: 1]\n",
      "4500 [D loss: 1.784904, acc.: 48.63%] [G loss: 0.205524] [Loss change: -0.006, Loss increases: 2]\n",
      "4600 [D loss: 1.654398, acc.: 49.41%] [G loss: 0.217784] [Loss change: 0.007, Loss increases: 1]\n",
      "4700 [D loss: 1.639142, acc.: 49.22%] [G loss: 0.210018] [Loss change: -0.002, Loss increases: 3]\n",
      "4800 [D loss: 1.543831, acc.: 49.80%] [G loss: 0.218428] [Loss change: 0.006, Loss increases: 1]\n",
      "4900 [D loss: 1.652425, acc.: 48.63%] [G loss: 0.256810] [Loss change: -0.001, Loss increases: 1]\n",
      "5000 [D loss: 1.597810, acc.: 49.02%] [G loss: 0.199213] [Loss change: -0.009, Loss increases: 0]\n",
      "5100 [D loss: 1.498835, acc.: 48.24%] [G loss: 0.252001] [Loss change: 0.028, Loss increases: 1]\n",
      "5200 [D loss: 1.649546, acc.: 47.85%] [G loss: 0.199851] [Loss change: -0.038, Loss increases: 0]\n",
      "5300 [D loss: 1.638101, acc.: 47.66%] [G loss: 0.230048] [Loss change: -0.010, Loss increases: 1]\n",
      "5400 [D loss: 1.594621, acc.: 47.85%] [G loss: 0.218258] [Loss change: -0.042, Loss increases: 0]\n",
      "5500 [D loss: 1.476378, acc.: 48.63%] [G loss: 0.257358] [Loss change: 0.006, Loss increases: 1]\n",
      "5600 [D loss: 1.343276, acc.: 49.41%] [G loss: 0.267599] [Loss change: -0.008, Loss increases: 0]\n",
      "5700 [D loss: 1.353401, acc.: 48.83%] [G loss: 0.299244] [Loss change: 0.025, Loss increases: 0]\n",
      "5800 [D loss: 1.241446, acc.: 49.22%] [G loss: 0.316115] [Loss change: 0.034, Loss increases: 0]\n",
      "5900 [D loss: 1.219654, acc.: 49.80%] [G loss: 0.346787] [Loss change: 0.029, Loss increases: 0]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6000 [D loss: 1.286019, acc.: 49.22%] [G loss: 0.347759] [Loss change: 0.046, Loss increases: 0]\n",
      "6100 [D loss: 1.286033, acc.: 48.83%] [G loss: 0.349053] [Loss change: 0.030, Loss increases: 0]\n",
      "6200 [D loss: 1.346358, acc.: 48.05%] [G loss: 0.392896] [Loss change: 0.019, Loss increases: 1]\n",
      "6300 [D loss: 1.218081, acc.: 49.41%] [G loss: 0.510860] [Loss change: 0.157, Loss increases: 0]\n",
      "6400 [D loss: 1.181913, acc.: 49.22%] [G loss: 0.429709] [Loss change: 0.042, Loss increases: 1]\n",
      "6500 [D loss: 1.208213, acc.: 49.41%] [G loss: 0.434765] [Loss change: 0.013, Loss increases: 1]\n",
      "6600 [D loss: 1.170781, acc.: 49.61%] [G loss: 0.392846] [Loss change: -0.046, Loss increases: 0]\n",
      "6700 [D loss: 1.068784, acc.: 50.00%] [G loss: 0.483136] [Loss change: 0.025, Loss increases: 1]\n",
      "6800 [D loss: 1.119442, acc.: 49.22%] [G loss: 0.465736] [Loss change: 0.015, Loss increases: 0]\n",
      "6900 [D loss: 1.092659, acc.: 49.61%] [G loss: 0.497908] [Loss change: 0.021, Loss increases: 0]\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0. 33.  1.  0.  0.  0.  0.  0.  0.  0.  1.  1.  0.  0.  5.  0.  0.\n",
      "   0.  0.  0.  0.  2.  0.  0.  0.  0.  5.  0.  0.  0. 23. 16. 13.  3. 14.\n",
      "   0.  0.  0. 19.  0.]\n",
      " [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  7.  0.  0.  9.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0.  0.  0. 11.  3.  0.  0. 41. 46. 30.  0. 12.\n",
      "   0.  0.  0. 64.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  43\n",
      "Attack type: land.     number predicted:  8\n",
      "Attack type: neptune.     number predicted:  42\n",
      "Attack type: nmap.     number predicted:  20\n",
      "Attack type: normal.     number predicted:  89\n",
      "Attack type: teardrop.     number predicted:  54\n",
      "\n",
      "[[ 0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0]\n",
      " [43  8 42 20 89  0 54]\n",
      " [ 0  0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 509   0   0   0   1   1   0   1   0 179   0   0  99   0\n",
      "    0   0   0 100   7   0]\n",
      " [  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 509   0   0   0   1   1   0   1   0 179   0   0  99   0\n",
      "    0   0   0 100   7   0]]\n",
      "0 [D loss: 8.341216, acc.: 50.00%] [G loss: 1.092537] [Loss change: 1.093, Loss increases: 0]\n",
      "100 [D loss: 0.614218, acc.: 52.15%] [G loss: 0.390852] [Loss change: 0.004, Loss increases: 1]\n",
      "200 [D loss: 1.227985, acc.: 50.20%] [G loss: 0.139602] [Loss change: 0.008, Loss increases: 0]\n",
      "300 [D loss: 1.496204, acc.: 50.00%] [G loss: 0.093043] [Loss change: -0.003, Loss increases: 1]\n",
      "400 [D loss: 1.602222, acc.: 50.00%] [G loss: 0.071023] [Loss change: -0.002, Loss increases: 1]\n",
      "500 [D loss: 1.621363, acc.: 49.80%] [G loss: 0.068353] [Loss change: 0.009, Loss increases: 0]\n",
      "600 [D loss: 1.650581, acc.: 49.80%] [G loss: 0.065430] [Loss change: 0.003, Loss increases: 0]\n",
      "700 [D loss: 1.613843, acc.: 49.80%] [G loss: 0.067872] [Loss change: 0.004, Loss increases: 0]\n",
      "800 [D loss: 1.555826, acc.: 50.00%] [G loss: 0.062988] [Loss change: -0.007, Loss increases: 1]\n",
      "900 [D loss: 1.535046, acc.: 50.00%] [G loss: 0.065872] [Loss change: -0.004, Loss increases: 3]\n",
      "1000 [D loss: 1.622050, acc.: 49.61%] [G loss: 0.067047] [Loss change: -0.007, Loss increases: 0]\n",
      "1100 [D loss: 1.516378, acc.: 49.80%] [G loss: 0.077548] [Loss change: 0.003, Loss increases: 1]\n",
      "1200 [D loss: 1.503286, acc.: 50.00%] [G loss: 0.072350] [Loss change: -0.014, Loss increases: 2]\n",
      "1300 [D loss: 1.513545, acc.: 49.61%] [G loss: 0.084381] [Loss change: -0.001, Loss increases: 4]\n",
      "1400 [D loss: 1.465222, acc.: 49.80%] [G loss: 0.077901] [Loss change: 0.001, Loss increases: 1]\n",
      "1500 [D loss: 1.507232, acc.: 49.22%] [G loss: 0.088563] [Loss change: 0.004, Loss increases: 1]\n",
      "1600 [D loss: 1.411585, acc.: 49.80%] [G loss: 0.080468] [Loss change: -0.010, Loss increases: 0]\n",
      "Stoping on iteration:  1663\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 37.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 36.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: neptune.     number predicted:  1\n",
      "Attack type: normal.     number predicted:  109\n",
      "Attack type: smurf.     number predicted:  145\n",
      "Attack type: teardrop.     number predicted:  1\n",
      "\n",
      "[[  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [  1 109   0 145   1]\n",
      " [  0   0   0   0   0]\n",
      " [  0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   5  10  29   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 108   0   0   0   1   0   0   1   0 180   0   0  43   0\n",
      "    0   0   0  40   0   0]\n",
      " [  0   1  41   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 503   0   0   1   1   0   0   1   0 180   0   0  99   0\n",
      "    0   7   1  93   0   0]]\n",
      "0 [D loss: 0.386989, acc.: 50.00%] [G loss: 0.509966] [Loss change: 0.510, Loss increases: 0]\n",
      "100 [D loss: 0.714550, acc.: 50.00%] [G loss: 0.332730] [Loss change: -0.008, Loss increases: 2]\n",
      "200 [D loss: 0.760418, acc.: 50.00%] [G loss: 0.301667] [Loss change: -0.010, Loss increases: 0]\n",
      "300 [D loss: 0.738048, acc.: 50.00%] [G loss: 0.300935] [Loss change: 0.004, Loss increases: 0]\n",
      "400 [D loss: 0.757098, acc.: 50.00%] [G loss: 0.293497] [Loss change: -0.006, Loss increases: 0]\n",
      "500 [D loss: 0.742457, acc.: 50.00%] [G loss: 0.299088] [Loss change: -0.000, Loss increases: 0]\n",
      "600 [D loss: 0.730973, acc.: 50.00%] [G loss: 0.303485] [Loss change: -0.003, Loss increases: 1]\n",
      "700 [D loss: 0.716098, acc.: 50.00%] [G loss: 0.307248] [Loss change: -0.001, Loss increases: 1]\n",
      "800 [D loss: 0.716602, acc.: 50.00%] [G loss: 0.315423] [Loss change: -0.008, Loss increases: 2]\n",
      "900 [D loss: 0.686622, acc.: 50.20%] [G loss: 0.326814] [Loss change: 0.003, Loss increases: 0]\n",
      "1000 [D loss: 0.682060, acc.: 50.20%] [G loss: 0.336442] [Loss change: 0.004, Loss increases: 0]\n",
      "1100 [D loss: 0.649265, acc.: 50.20%] [G loss: 0.345205] [Loss change: 0.007, Loss increases: 0]\n",
      "1200 [D loss: 0.650051, acc.: 50.00%] [G loss: 0.342983] [Loss change: -0.006, Loss increases: 0]\n",
      "1300 [D loss: 0.643690, acc.: 50.00%] [G loss: 0.352698] [Loss change: -0.003, Loss increases: 1]\n",
      "1400 [D loss: 0.622797, acc.: 50.00%] [G loss: 0.364260] [Loss change: -0.006, Loss increases: 1]\n",
      "1500 [D loss: 0.611896, acc.: 50.00%] [G loss: 0.378543] [Loss change: 0.002, Loss increases: 1]\n",
      "1600 [D loss: 0.587987, acc.: 50.00%] [G loss: 0.387917] [Loss change: -0.001, Loss increases: 0]\n",
      "1700 [D loss: 0.577342, acc.: 50.00%] [G loss: 0.408572] [Loss change: 0.001, Loss increases: 3]\n",
      "1800 [D loss: 0.547281, acc.: 50.00%] [G loss: 0.445490] [Loss change: 0.003, Loss increases: 0]\n",
      "Stoping on iteration:  1888\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  7.  0.  0. 43.  0.  0.  0. 65.  0.  0.  0.\n",
      "  36.  0.  0.  0.  9. 13.  0.  0.  0.  0.  7.  0.  0.  0.  0.  0.  0. 40.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0.  0.  8.  0.  0.  1.  0.  2.  0.  0.  0.  0. 17.  0.  0.  0. 15.\n",
      "   0.  0. 43. 27.  0.  0.  5.  0.  0.  0.  0.  0.  0. 32. 28. 19.  0.  0.\n",
      "   0.  0.  0.  0. 36.]]\n",
      "Attack type: ipsweep.     number predicted:  116\n",
      "Attack type: normal.     number predicted:  34\n",
      "Attack type: portsweep.     number predicted:  2\n",
      "Attack type: smurf.     number predicted:  74\n",
      "Attack type: teardrop.     number predicted:  18\n",
      "Attack type: warezclient.     number predicted:  12\n",
      "\n",
      "[[  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [116  34   2   0  74  18  12]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   2  46   5   1   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   3   3   0   0   0   0   1   0   0 175   3   2  41  77\n",
      "    0   0   0  22   0   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 175   0   0  99   0\n",
      "    0   7   0  93   7   0]]\n",
      "0 [D loss: 7.479406, acc.: 5.86%] [G loss: 0.580009] [Loss change: 0.580, Loss increases: 0]\n",
      "100 [D loss: 1.089805, acc.: 50.00%] [G loss: 0.197247] [Loss change: 0.007, Loss increases: 0]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "200 [D loss: 1.557178, acc.: 50.00%] [G loss: 0.093125] [Loss change: -0.010, Loss increases: 0]\n",
      "300 [D loss: 1.749864, acc.: 50.00%] [G loss: 0.088928] [Loss change: 0.011, Loss increases: 0]\n",
      "400 [D loss: 2.006478, acc.: 50.00%] [G loss: 0.055091] [Loss change: -0.007, Loss increases: 0]\n",
      "500 [D loss: 2.116481, acc.: 49.41%] [G loss: 0.049431] [Loss change: 0.009, Loss increases: 0]\n",
      "600 [D loss: 2.134297, acc.: 49.80%] [G loss: 0.035462] [Loss change: 0.002, Loss increases: 0]\n",
      "700 [D loss: 2.268686, acc.: 49.61%] [G loss: 0.028311] [Loss change: -0.003, Loss increases: 0]\n",
      "800 [D loss: 2.233314, acc.: 49.41%] [G loss: 0.031139] [Loss change: -0.007, Loss increases: 1]\n",
      "900 [D loss: 2.216109, acc.: 49.22%] [G loss: 0.034163] [Loss change: 0.001, Loss increases: 0]\n",
      "1000 [D loss: 2.116244, acc.: 49.02%] [G loss: 0.030685] [Loss change: -0.001, Loss increases: 0]\n",
      "1100 [D loss: 2.071969, acc.: 49.61%] [G loss: 0.033656] [Loss change: -0.010, Loss increases: 1]\n",
      "1200 [D loss: 2.071947, acc.: 49.02%] [G loss: 0.036804] [Loss change: 0.005, Loss increases: 0]\n",
      "1300 [D loss: 2.026871, acc.: 49.02%] [G loss: 0.035243] [Loss change: 0.001, Loss increases: 1]\n",
      "1400 [D loss: 2.050027, acc.: 48.83%] [G loss: 0.038059] [Loss change: -0.001, Loss increases: 0]\n",
      "1500 [D loss: 1.963496, acc.: 49.22%] [G loss: 0.036874] [Loss change: -0.006, Loss increases: 2]\n",
      "1600 [D loss: 1.893777, acc.: 49.41%] [G loss: 0.043913] [Loss change: -0.004, Loss increases: 3]\n",
      "1700 [D loss: 1.910784, acc.: 49.02%] [G loss: 0.045491] [Loss change: -0.003, Loss increases: 0]\n",
      "1800 [D loss: 1.813861, acc.: 49.80%] [G loss: 0.049524] [Loss change: -0.004, Loss increases: 2]\n",
      "1900 [D loss: 1.863434, acc.: 49.41%] [G loss: 0.053027] [Loss change: 0.003, Loss increases: 0]\n",
      "2000 [D loss: 1.888106, acc.: 49.41%] [G loss: 0.052631] [Loss change: -0.000, Loss increases: 1]\n",
      "2100 [D loss: 1.873516, acc.: 49.02%] [G loss: 0.063620] [Loss change: 0.003, Loss increases: 1]\n",
      "2200 [D loss: 1.888248, acc.: 49.41%] [G loss: 0.066438] [Loss change: 0.005, Loss increases: 2]\n",
      "2300 [D loss: 1.819657, acc.: 49.41%] [G loss: 0.065477] [Loss change: 0.004, Loss increases: 1]\n",
      "2400 [D loss: 1.821663, acc.: 49.61%] [G loss: 0.063452] [Loss change: -0.008, Loss increases: 3]\n",
      "2500 [D loss: 1.826635, acc.: 49.22%] [G loss: 0.068435] [Loss change: -0.007, Loss increases: 1]\n",
      "2600 [D loss: 1.821900, acc.: 49.41%] [G loss: 0.085673] [Loss change: 0.004, Loss increases: 1]\n",
      "2700 [D loss: 1.792001, acc.: 49.02%] [G loss: 0.070636] [Loss change: -0.004, Loss increases: 0]\n",
      "2800 [D loss: 1.777749, acc.: 49.22%] [G loss: 0.082310] [Loss change: 0.013, Loss increases: 0]\n",
      "2900 [D loss: 1.730245, acc.: 49.80%] [G loss: 0.082929] [Loss change: -0.012, Loss increases: 4]\n",
      "3000 [D loss: 1.726841, acc.: 49.41%] [G loss: 0.101036] [Loss change: 0.014, Loss increases: 2]\n",
      "3100 [D loss: 1.738289, acc.: 49.80%] [G loss: 0.087130] [Loss change: 0.006, Loss increases: 0]\n",
      "3200 [D loss: 1.832463, acc.: 49.80%] [G loss: 0.087317] [Loss change: -0.031, Loss increases: 1]\n",
      "3300 [D loss: 1.912509, acc.: 48.83%] [G loss: 0.092217] [Loss change: -0.022, Loss increases: 2]\n",
      "3400 [D loss: 1.701343, acc.: 49.80%] [G loss: 0.126964] [Loss change: 0.024, Loss increases: 2]\n",
      "3500 [D loss: 1.825795, acc.: 49.61%] [G loss: 0.112508] [Loss change: -0.012, Loss increases: 1]\n",
      "3600 [D loss: 1.808135, acc.: 49.61%] [G loss: 0.120275] [Loss change: -0.001, Loss increases: 1]\n",
      "3700 [D loss: 1.903669, acc.: 49.22%] [G loss: 0.123175] [Loss change: 0.004, Loss increases: 0]\n",
      "3800 [D loss: 2.120601, acc.: 47.66%] [G loss: 0.117325] [Loss change: 0.005, Loss increases: 0]\n",
      "3900 [D loss: 1.931011, acc.: 49.41%] [G loss: 0.126042] [Loss change: -0.009, Loss increases: 1]\n",
      "4000 [D loss: 1.960260, acc.: 48.44%] [G loss: 0.133204] [Loss change: -0.028, Loss increases: 2]\n",
      "4100 [D loss: 2.010523, acc.: 48.63%] [G loss: 0.142964] [Loss change: 0.019, Loss increases: 0]\n",
      "4200 [D loss: 1.971584, acc.: 48.44%] [G loss: 0.176647] [Loss change: 0.027, Loss increases: 1]\n",
      "4300 [D loss: 1.926822, acc.: 49.02%] [G loss: 0.134604] [Loss change: -0.046, Loss increases: 1]\n",
      "4400 [D loss: 1.771307, acc.: 49.61%] [G loss: 0.175387] [Loss change: -0.006, Loss increases: 2]\n",
      "4500 [D loss: 1.892658, acc.: 49.61%] [G loss: 0.193197] [Loss change: 0.026, Loss increases: 0]\n",
      "4600 [D loss: 1.932699, acc.: 49.41%] [G loss: 0.169925] [Loss change: -0.024, Loss increases: 0]\n",
      "4700 [D loss: 2.012453, acc.: 49.22%] [G loss: 0.172032] [Loss change: -0.002, Loss increases: 0]\n",
      "4800 [D loss: 1.786849, acc.: 49.41%] [G loss: 0.229464] [Loss change: 0.023, Loss increases: 0]\n",
      "4900 [D loss: 1.645444, acc.: 50.00%] [G loss: 0.251047] [Loss change: 0.008, Loss increases: 1]\n",
      "5000 [D loss: 2.063412, acc.: 48.63%] [G loss: 0.180339] [Loss change: -0.002, Loss increases: 0]\n",
      "5100 [D loss: 1.810585, acc.: 49.41%] [G loss: 0.306017] [Loss change: 0.107, Loss increases: 1]\n",
      "5200 [D loss: 1.863300, acc.: 48.44%] [G loss: 0.263056] [Loss change: -0.031, Loss increases: 2]\n",
      "5300 [D loss: 1.905818, acc.: 49.22%] [G loss: 0.239372] [Loss change: -0.081, Loss increases: 2]\n",
      "5400 [D loss: 1.860888, acc.: 49.22%] [G loss: 0.256521] [Loss change: -0.050, Loss increases: 1]\n",
      "5500 [D loss: 1.724142, acc.: 49.22%] [G loss: 0.324595] [Loss change: 0.022, Loss increases: 0]\n",
      "5600 [D loss: 1.881585, acc.: 49.02%] [G loss: 0.300151] [Loss change: -0.035, Loss increases: 0]\n",
      "5700 [D loss: 1.581109, acc.: 50.00%] [G loss: 0.411588] [Loss change: 0.082, Loss increases: 1]\n",
      "5800 [D loss: 1.768884, acc.: 49.02%] [G loss: 0.342474] [Loss change: 0.033, Loss increases: 0]\n",
      "5900 [D loss: 1.896254, acc.: 48.05%] [G loss: 0.361251] [Loss change: -0.032, Loss increases: 0]\n",
      "6000 [D loss: 1.796344, acc.: 49.02%] [G loss: 0.396518] [Loss change: -0.005, Loss increases: 0]\n",
      "6100 [D loss: 2.236511, acc.: 47.27%] [G loss: 0.351606] [Loss change: 0.005, Loss increases: 1]\n",
      "6200 [D loss: 2.919445, acc.: 45.12%] [G loss: 0.368389] [Loss change: 0.040, Loss increases: 0]\n",
      "6300 [D loss: 2.811497, acc.: 44.34%] [G loss: 0.372969] [Loss change: 0.003, Loss increases: 0]\n",
      "6400 [D loss: 2.674388, acc.: 43.75%] [G loss: 0.306994] [Loss change: -0.107, Loss increases: 0]\n",
      "6500 [D loss: 2.531500, acc.: 44.34%] [G loss: 0.396465] [Loss change: -0.015, Loss increases: 0]\n",
      "6600 [D loss: 2.566469, acc.: 42.97%] [G loss: 0.358416] [Loss change: -0.184, Loss increases: 1]\n",
      "6700 [D loss: 2.352831, acc.: 45.12%] [G loss: 0.439834] [Loss change: -0.011, Loss increases: 1]\n",
      "6800 [D loss: 2.498178, acc.: 44.14%] [G loss: 0.597155] [Loss change: 0.191, Loss increases: 0]\n",
      "6900 [D loss: 2.422477, acc.: 44.34%] [G loss: 0.561724] [Loss change: 0.011, Loss increases: 2]\n",
      "Generated Satan attacks: \n",
      "[[  0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0.   0.   0.   0.   0.   0. 231.   0.   0.   0.   0.  17.\n",
      "    0.   0.   0.  17.   0.   0.  21.   0.   0.   0.   0.   0.   0.]\n",
      " [  0.   0.   0.  13.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0.  34.   0.   0.   7.   2.   0.  20.   0.  21.   0.]]\n",
      "Attack type: neptune.     number predicted:  39\n",
      "Attack type: nmap.     number predicted:  54\n",
      "Attack type: teardrop.     number predicted:  163\n",
      "\n",
      "[[  0   0   0   0]\n",
      " [  0   0   0   0]\n",
      " [ 39  54   0 163]\n",
      " [  0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  41   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   1   1   0   0   1   0 179   0   0  99   0\n",
      "    0  23   1  77   0   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 179   0   0  99   0\n",
      "    0   2   0  98   8   0]]\n",
      "0 [D loss: 0.374446, acc.: 50.78%] [G loss: 0.602660] [Loss change: 0.603, Loss increases: 0]\n",
      "100 [D loss: 0.580676, acc.: 50.59%] [G loss: 0.432541] [Loss change: -0.006, Loss increases: 1]\n",
      "200 [D loss: 0.651940, acc.: 50.78%] [G loss: 0.383637] [Loss change: -0.003, Loss increases: 1]\n",
      "Stoping on iteration:  292\n",
      "Generated Satan attacks: \n",
      "[[2. 3. 0. 1. 1. 0. 0. 3. 0. 0. 0. 0. 0. 0. 1. 0. 0. 3. 0. 3. 0. 0. 1. 1.\n",
      "  0. 0. 0. 0. 0. 0. 4. 0. 2. 0. 1. 3. 0. 2. 1. 0. 2.]\n",
      " [0. 0. 0. 2. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 2. 0. 0. 0.\n",
      "  0. 1. 0. 0. 0. 1. 1. 2. 1. 0. 0. 1. 0. 0. 1. 0. 0.]]\n",
      "Attack type: ipsweep.     number predicted:  4\n",
      "Attack type: land.     number predicted:  4\n",
      "Attack type: neptune.     number predicted:  33\n",
      "Attack type: normal.     number predicted:  34\n",
      "Attack type: portsweep.     number predicted:  9\n",
      "Attack type: smurf.     number predicted:  143\n",
      "Attack type: warezclient.     number predicted:  29\n",
      "\n",
      "[[  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  4   4  33  34   9   0 143  29]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  41   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 503   0   0   1   1   0   0   1   0 175   0   0  99   0\n",
      "    0  30   1  70   0   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 175   0   0  99   0\n",
      "    0  27   0  73   7   0]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 [D loss: 1.097879, acc.: 77.73%] [G loss: 0.828900] [Loss change: 0.829, Loss increases: 0]\n",
      "100 [D loss: 0.638654, acc.: 50.20%] [G loss: 0.396239] [Loss change: 0.009, Loss increases: 0]\n",
      "200 [D loss: 0.695363, acc.: 50.00%] [G loss: 0.333161] [Loss change: -0.000, Loss increases: 1]\n",
      "300 [D loss: 0.761171, acc.: 50.00%] [G loss: 0.320636] [Loss change: 0.007, Loss increases: 0]\n",
      "400 [D loss: 0.742206, acc.: 50.00%] [G loss: 0.296659] [Loss change: -0.009, Loss increases: 0]\n",
      "500 [D loss: 0.753890, acc.: 50.20%] [G loss: 0.301282] [Loss change: 0.002, Loss increases: 3]\n",
      "Stoping on iteration:  502\n",
      "Generated Satan attacks: \n",
      "[[ 1.  0.  5.  0.  2.  5.  0.  0.  0.  0.  0.  1.  0.  0.  0.  5.  0.  0.\n",
      "   0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0. 13.  0.  0.  7.  6.\n",
      "   0.  0.  0.  5.  0.]\n",
      " [ 0.  0.  6.  0.  1.  1.  0.  1.  1.  0.  0.  0.  0.  0.  0.  5.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  7.  0.  0.  5.  5.\n",
      "   0.  1.  0.  1.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  10\n",
      "Attack type: land.     number predicted:  87\n",
      "Attack type: neptune.     number predicted:  2\n",
      "Attack type: nmap.     number predicted:  19\n",
      "Attack type: normal.     number predicted:  76\n",
      "Attack type: smurf.     number predicted:  36\n",
      "Attack type: teardrop.     number predicted:  8\n",
      "Attack type: warezclient.     number predicted:  18\n",
      "\n",
      "[[ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [10 87  2 19 76  0 36  8 18]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 176   0   0  99   0\n",
      "    0   4   0  96   8   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 176   0   0  99   0\n",
      "    0   5   0  95   8   0]]\n",
      "0 [D loss: 0.377286, acc.: 50.39%] [G loss: 0.516304] [Loss change: 0.516, Loss increases: 0]\n",
      "100 [D loss: 0.667284, acc.: 50.00%] [G loss: 0.342367] [Loss change: -0.000, Loss increases: 0]\n",
      "200 [D loss: 0.692744, acc.: 50.00%] [G loss: 0.330151] [Loss change: -0.013, Loss increases: 1]\n",
      "300 [D loss: 0.696157, acc.: 50.00%] [G loss: 0.328946] [Loss change: 0.001, Loss increases: 0]\n",
      "400 [D loss: 0.706370, acc.: 50.00%] [G loss: 0.325588] [Loss change: -0.004, Loss increases: 0]\n",
      "500 [D loss: 0.689790, acc.: 50.20%] [G loss: 0.332997] [Loss change: -0.006, Loss increases: 1]\n",
      "600 [D loss: 0.711052, acc.: 50.00%] [G loss: 0.327528] [Loss change: -0.005, Loss increases: 0]\n",
      "700 [D loss: 0.686820, acc.: 50.20%] [G loss: 0.337240] [Loss change: -0.006, Loss increases: 2]\n",
      "800 [D loss: 0.677452, acc.: 50.00%] [G loss: 0.340491] [Loss change: -0.005, Loss increases: 0]\n",
      "900 [D loss: 0.640977, acc.: 50.20%] [G loss: 0.354588] [Loss change: -0.000, Loss increases: 0]\n",
      "1000 [D loss: 0.647800, acc.: 50.00%] [G loss: 0.357845] [Loss change: -0.002, Loss increases: 1]\n",
      "1100 [D loss: 0.642839, acc.: 50.00%] [G loss: 0.360832] [Loss change: -0.001, Loss increases: 0]\n",
      "1200 [D loss: 0.641152, acc.: 50.00%] [G loss: 0.361931] [Loss change: -0.011, Loss increases: 4]\n",
      "1300 [D loss: 0.603478, acc.: 50.00%] [G loss: 0.386325] [Loss change: 0.006, Loss increases: 0]\n",
      "1400 [D loss: 0.594829, acc.: 50.00%] [G loss: 0.396038] [Loss change: -0.001, Loss increases: 0]\n",
      "1500 [D loss: 0.574731, acc.: 49.80%] [G loss: 0.409459] [Loss change: -0.000, Loss increases: 0]\n",
      "1600 [D loss: 0.555475, acc.: 50.00%] [G loss: 0.440787] [Loss change: 0.004, Loss increases: 1]\n",
      "Stoping on iteration:  1673\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  1. 17.  0.  0.  0.  0.  0.  0.  0.  0.  0. 23.  0.  0.\n",
      "   0.  6.  2.  0.  0.  0. 25.  0.  0.  0.  0.  0.  0. 15.  0.  0.  0.  3.\n",
      "   0.  0.  0.  2.  1.]\n",
      " [ 0.  9.  1.  0.  0.  0.  0.  0.  0.  0.  5.  0.  0. 15.  0.  0.  6.  9.\n",
      "  10.  1.  0.  0.  0. 11.  0.  0.  0.  0.  0.  0.  0.  4.  0.  0.  9.  7.\n",
      "   2. 16.  0.  3.  0.]]\n",
      "Attack type: land.     number predicted:  12\n",
      "Attack type: nmap.     number predicted:  7\n",
      "Attack type: normal.     number predicted:  228\n",
      "Attack type: smurf.     number predicted:  3\n",
      "Attack type: teardrop.     number predicted:  6\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [ 12   7 228   0   3   6]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0  18   0  82   8   0]\n",
      " [  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   8   0  92   8   0]]\n",
      "0 [D loss: 8.210391, acc.: 49.61%] [G loss: 0.858367] [Loss change: 0.858, Loss increases: 0]\n",
      "100 [D loss: 0.970369, acc.: 50.00%] [G loss: 0.215639] [Loss change: -0.018, Loss increases: 2]\n",
      "200 [D loss: 1.385034, acc.: 50.00%] [G loss: 0.099899] [Loss change: -0.009, Loss increases: 0]\n",
      "300 [D loss: 1.531175, acc.: 50.00%] [G loss: 0.073198] [Loss change: 0.000, Loss increases: 0]\n",
      "400 [D loss: 1.639726, acc.: 50.00%] [G loss: 0.071441] [Loss change: 0.007, Loss increases: 0]\n",
      "Stoping on iteration:  419\n",
      "Generated Satan attacks: \n",
      "[[ 2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  4.  0.  0.  0.  0.  0.  0.  0.  0.  5.  0.  4.\n",
      "   0.  0.  0. 14.  0.]\n",
      " [ 0.  0.  6.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  6.  0.  0.  3.  0.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  3\n",
      "Attack type: land.     number predicted:  6\n",
      "Attack type: nmap.     number predicted:  5\n",
      "Attack type: normal.     number predicted:  29\n",
      "Attack type: portsweep.     number predicted:  13\n",
      "Attack type: smurf.     number predicted:  139\n",
      "Attack type: teardrop.     number predicted:  61\n",
      "\n",
      "[[  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  3   6   5  29  13   0 139  61]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 177   0   0  99   0\n",
      "    0   9   0  91   6   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 177   0   0  99   0\n",
      "    0   7   0  93   6   0]]\n",
      "0 [D loss: 8.352892, acc.: 50.00%] [G loss: 1.059456] [Loss change: 1.059, Loss increases: 0]\n",
      "100 [D loss: 0.497386, acc.: 57.23%] [G loss: 0.520571] [Loss change: -0.009, Loss increases: 0]\n",
      "200 [D loss: 0.868528, acc.: 50.59%] [G loss: 0.286906] [Loss change: 0.002, Loss increases: 0]\n",
      "300 [D loss: 1.228342, acc.: 51.76%] [G loss: 0.157532] [Loss change: -0.003, Loss increases: 3]\n",
      "400 [D loss: 1.458758, acc.: 49.80%] [G loss: 0.084433] [Loss change: 0.014, Loss increases: 0]\n",
      "500 [D loss: 1.551371, acc.: 50.00%] [G loss: 0.074051] [Loss change: -0.002, Loss increases: 0]\n",
      "600 [D loss: 1.542085, acc.: 49.61%] [G loss: 0.078102] [Loss change: 0.007, Loss increases: 2]\n",
      "700 [D loss: 1.536943, acc.: 49.80%] [G loss: 0.070617] [Loss change: -0.006, Loss increases: 1]\n",
      "800 [D loss: 1.517164, acc.: 50.00%] [G loss: 0.069225] [Loss change: -0.003, Loss increases: 0]\n",
      "900 [D loss: 1.521265, acc.: 49.80%] [G loss: 0.071377] [Loss change: -0.001, Loss increases: 1]\n",
      "1000 [D loss: 1.497473, acc.: 49.80%] [G loss: 0.073139] [Loss change: -0.008, Loss increases: 2]\n",
      "1100 [D loss: 1.483040, acc.: 49.22%] [G loss: 0.087462] [Loss change: 0.010, Loss increases: 0]\n",
      "1200 [D loss: 1.415554, acc.: 50.00%] [G loss: 0.081820] [Loss change: -0.003, Loss increases: 1]\n",
      "1300 [D loss: 1.398777, acc.: 49.61%] [G loss: 0.082768] [Loss change: -0.001, Loss increases: 0]\n",
      "1400 [D loss: 1.478464, acc.: 49.22%] [G loss: 0.081571] [Loss change: -0.010, Loss increases: 4]\n",
      "1500 [D loss: 1.431804, acc.: 49.61%] [G loss: 0.089992] [Loss change: -0.006, Loss increases: 1]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1600 [D loss: 1.373555, acc.: 50.00%] [G loss: 0.096733] [Loss change: 0.003, Loss increases: 2]\n",
      "1700 [D loss: 1.347362, acc.: 49.61%] [G loss: 0.094141] [Loss change: 0.000, Loss increases: 1]\n",
      "1800 [D loss: 1.328309, acc.: 50.00%] [G loss: 0.099104] [Loss change: -0.006, Loss increases: 2]\n",
      "1900 [D loss: 1.308074, acc.: 50.00%] [G loss: 0.107712] [Loss change: 0.001, Loss increases: 0]\n",
      "2000 [D loss: 1.286027, acc.: 50.00%] [G loss: 0.110641] [Loss change: -0.001, Loss increases: 3]\n",
      "2100 [D loss: 1.306069, acc.: 49.61%] [G loss: 0.112228] [Loss change: -0.006, Loss increases: 1]\n",
      "2200 [D loss: 1.279080, acc.: 49.41%] [G loss: 0.119842] [Loss change: -0.012, Loss increases: 1]\n",
      "2300 [D loss: 1.238366, acc.: 49.80%] [G loss: 0.128275] [Loss change: 0.006, Loss increases: 0]\n",
      "2400 [D loss: 1.254111, acc.: 49.61%] [G loss: 0.135334] [Loss change: 0.011, Loss increases: 0]\n",
      "2500 [D loss: 1.207334, acc.: 49.80%] [G loss: 0.138309] [Loss change: -0.002, Loss increases: 1]\n",
      "2600 [D loss: 1.206800, acc.: 49.22%] [G loss: 0.140072] [Loss change: -0.002, Loss increases: 2]\n",
      "2700 [D loss: 1.216026, acc.: 49.41%] [G loss: 0.149969] [Loss change: 0.010, Loss increases: 0]\n",
      "2800 [D loss: 1.210607, acc.: 49.61%] [G loss: 0.148438] [Loss change: -0.002, Loss increases: 1]\n",
      "2900 [D loss: 1.174183, acc.: 49.41%] [G loss: 0.160224] [Loss change: -0.000, Loss increases: 1]\n",
      "3000 [D loss: 1.145800, acc.: 49.41%] [G loss: 0.162469] [Loss change: 0.009, Loss increases: 0]\n",
      "3100 [D loss: 1.179969, acc.: 49.02%] [G loss: 0.158417] [Loss change: -0.016, Loss increases: 2]\n",
      "3200 [D loss: 1.126178, acc.: 49.41%] [G loss: 0.174066] [Loss change: 0.005, Loss increases: 1]\n",
      "3300 [D loss: 1.172947, acc.: 48.83%] [G loss: 0.180604] [Loss change: -0.012, Loss increases: 1]\n",
      "3400 [D loss: 1.117582, acc.: 49.02%] [G loss: 0.190880] [Loss change: 0.001, Loss increases: 1]\n",
      "3500 [D loss: 1.137111, acc.: 49.02%] [G loss: 0.194426] [Loss change: -0.008, Loss increases: 1]\n",
      "3600 [D loss: 1.050761, acc.: 49.80%] [G loss: 0.202945] [Loss change: -0.021, Loss increases: 1]\n",
      "3700 [D loss: 1.080992, acc.: 49.02%] [G loss: 0.220638] [Loss change: 0.008, Loss increases: 0]\n",
      "3800 [D loss: 1.026090, acc.: 49.41%] [G loss: 0.227391] [Loss change: -0.003, Loss increases: 2]\n",
      "Stoping on iteration:  3876\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 75.  0.  0.  0.  0.  1.  0.  0.  0.  0.  5.  0.  6.  1.\n",
      "   0.  0.  0.  4.  0.]\n",
      " [ 0.  0.  3.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 57.  0.  0.  0.  0.  0.  0.  2.  0. 10.  7.  1. 10.  1.\n",
      "   0.  0.  0.  2.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  78\n",
      "Attack type: nmap.     number predicted:  78\n",
      "Attack type: portsweep.     number predicted:  56\n",
      "Attack type: teardrop.     number predicted:  44\n",
      "\n",
      "[[ 0  0  0  0  0]\n",
      " [ 0  0  0  0  0]\n",
      " [ 0  0  0  0  0]\n",
      " [78 78 56  0 44]\n",
      " [ 0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 173   0   0  99   0\n",
      "    0   0   0 100   8   0]\n",
      " [  0   2  47   6   1   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0  42  10   0   0   0   0   0   0   0 173  10   4  52  61\n",
      "    0   0   0  39   0   0]]\n",
      "0 [D loss: 7.715606, acc.: 48.63%] [G loss: 0.846795] [Loss change: 0.847, Loss increases: 0]\n",
      "100 [D loss: 0.706582, acc.: 50.00%] [G loss: 0.349115] [Loss change: 0.007, Loss increases: 0]\n",
      "200 [D loss: 1.043750, acc.: 50.00%] [G loss: 0.189404] [Loss change: 0.008, Loss increases: 0]\n",
      "300 [D loss: 1.380396, acc.: 50.20%] [G loss: 0.115915] [Loss change: 0.000, Loss increases: 0]\n",
      "400 [D loss: 1.613156, acc.: 50.00%] [G loss: 0.083935] [Loss change: 0.002, Loss increases: 1]\n",
      "500 [D loss: 1.679697, acc.: 50.00%] [G loss: 0.062025] [Loss change: -0.000, Loss increases: 1]\n",
      "600 [D loss: 1.642370, acc.: 50.00%] [G loss: 0.066641] [Loss change: 0.008, Loss increases: 0]\n",
      "700 [D loss: 1.738693, acc.: 50.00%] [G loss: 0.059738] [Loss change: 0.002, Loss increases: 0]\n",
      "800 [D loss: 1.671252, acc.: 50.00%] [G loss: 0.062869] [Loss change: 0.004, Loss increases: 0]\n",
      "Stoping on iteration:  864\n",
      "Generated Satan attacks: \n",
      "[[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 9. 0.\n",
      "  0. 0. 0. 0. 0. 0. 0. 3. 0. 0. 4. 0. 0. 0. 0. 3. 0.]\n",
      " [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 9. 0.\n",
      "  0. 0. 0. 0. 0. 0. 0. 7. 0. 0. 6. 0. 0. 0. 0. 4. 0.]]\n",
      "Attack type: ipsweep.     number predicted:  34\n",
      "Attack type: portsweep.     number predicted:  19\n",
      "Attack type: smurf.     number predicted:  55\n",
      "Attack type: teardrop.     number predicted:  148\n",
      "\n",
      "[[  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [ 34  19   0  55 148]\n",
      " [  0   0   0   0   0]\n",
      " [  0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  43   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   1   1   0   0   1   0 174   0   0  99   0\n",
      "    0  22   1  76   0   0]\n",
      " [  0   1  43   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0  79   0   0   0   1   1   0   1   0 174   0   0  33   0\n",
      "    0   0   0  30   6   0]]\n",
      "0 [D loss: 8.349394, acc.: 50.00%] [G loss: 1.223391] [Loss change: 1.223, Loss increases: 0]\n",
      "100 [D loss: 0.591386, acc.: 54.49%] [G loss: 0.452148] [Loss change: 0.001, Loss increases: 0]\n",
      "200 [D loss: 1.081845, acc.: 50.39%] [G loss: 0.225587] [Loss change: 0.006, Loss increases: 1]\n",
      "300 [D loss: 1.447507, acc.: 50.59%] [G loss: 0.152706] [Loss change: 0.007, Loss increases: 2]\n",
      "400 [D loss: 1.641734, acc.: 49.80%] [G loss: 0.111631] [Loss change: 0.011, Loss increases: 0]\n",
      "500 [D loss: 1.604707, acc.: 49.61%] [G loss: 0.088566] [Loss change: -0.012, Loss increases: 0]\n",
      "600 [D loss: 1.632476, acc.: 49.80%] [G loss: 0.083035] [Loss change: 0.001, Loss increases: 0]\n",
      "700 [D loss: 1.690674, acc.: 50.00%] [G loss: 0.080220] [Loss change: 0.008, Loss increases: 0]\n",
      "800 [D loss: 1.579326, acc.: 50.00%] [G loss: 0.069032] [Loss change: -0.006, Loss increases: 1]\n",
      "900 [D loss: 1.562234, acc.: 50.00%] [G loss: 0.079520] [Loss change: -0.002, Loss increases: 1]\n",
      "1000 [D loss: 1.502093, acc.: 50.00%] [G loss: 0.079805] [Loss change: 0.012, Loss increases: 0]\n",
      "1100 [D loss: 1.480174, acc.: 50.00%] [G loss: 0.078378] [Loss change: -0.005, Loss increases: 1]\n",
      "Stoping on iteration:  1153\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  8.  0.  0.  0.  0.  0.  0.  0.  0.  0.  3.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  9.  0.\n",
      "   0.  0.  0. 14.  0.]\n",
      " [ 0.  0.  3.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  8.  0.  0.  0.  0.  0.  0.  0.  0.  2.  0.  0.  6.  0.\n",
      "   0.  0.  0.  4.  0.]]\n",
      "Attack type: land.     number predicted:  1\n",
      "Attack type: nmap.     number predicted:  38\n",
      "Attack type: portsweep.     number predicted:  4\n",
      "Attack type: smurf.     number predicted:  152\n",
      "Attack type: teardrop.     number predicted:  61\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  1  38   4   0 152  61]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 184   0   0  99   0\n",
      "    0  18   0  82   8   0]\n",
      " [  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 184   0   0  99   0\n",
      "    0   4   0  96   8   0]]\n",
      "0 [D loss: 0.382814, acc.: 50.00%] [G loss: 0.420061] [Loss change: 0.420, Loss increases: 0]\n",
      "100 [D loss: 0.805144, acc.: 50.00%] [G loss: 0.271173] [Loss change: -0.002, Loss increases: 0]\n",
      "200 [D loss: 0.829840, acc.: 50.00%] [G loss: 0.254148] [Loss change: 0.005, Loss increases: 1]\n",
      "300 [D loss: 0.830849, acc.: 50.00%] [G loss: 0.244249] [Loss change: -0.004, Loss increases: 1]\n",
      "400 [D loss: 0.844531, acc.: 50.00%] [G loss: 0.233954] [Loss change: -0.007, Loss increases: 1]\n",
      "500 [D loss: 0.823417, acc.: 49.80%] [G loss: 0.244904] [Loss change: 0.003, Loss increases: 0]\n",
      "600 [D loss: 0.825975, acc.: 50.00%] [G loss: 0.238877] [Loss change: -0.002, Loss increases: 1]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "700 [D loss: 0.797218, acc.: 50.00%] [G loss: 0.248504] [Loss change: 0.005, Loss increases: 0]\n",
      "800 [D loss: 0.781107, acc.: 50.00%] [G loss: 0.253360] [Loss change: 0.000, Loss increases: 2]\n",
      "900 [D loss: 0.767821, acc.: 50.00%] [G loss: 0.255823] [Loss change: -0.005, Loss increases: 0]\n",
      "1000 [D loss: 0.767623, acc.: 50.00%] [G loss: 0.261098] [Loss change: 0.000, Loss increases: 0]\n",
      "1100 [D loss: 0.750912, acc.: 50.00%] [G loss: 0.269062] [Loss change: 0.004, Loss increases: 0]\n",
      "1200 [D loss: 0.742226, acc.: 50.00%] [G loss: 0.277125] [Loss change: -0.002, Loss increases: 1]\n",
      "1300 [D loss: 0.734452, acc.: 50.00%] [G loss: 0.284722] [Loss change: 0.002, Loss increases: 0]\n",
      "1400 [D loss: 0.710512, acc.: 50.00%] [G loss: 0.295786] [Loss change: 0.003, Loss increases: 0]\n",
      "1500 [D loss: 0.694906, acc.: 50.00%] [G loss: 0.306022] [Loss change: 0.002, Loss increases: 0]\n",
      "1600 [D loss: 0.678829, acc.: 50.00%] [G loss: 0.315924] [Loss change: -0.001, Loss increases: 0]\n",
      "1700 [D loss: 0.657892, acc.: 50.00%] [G loss: 0.328267] [Loss change: -0.000, Loss increases: 0]\n",
      "1800 [D loss: 0.646833, acc.: 50.00%] [G loss: 0.338889] [Loss change: 0.001, Loss increases: 0]\n",
      "1900 [D loss: 0.630166, acc.: 50.00%] [G loss: 0.352802] [Loss change: 0.003, Loss increases: 1]\n",
      "2000 [D loss: 0.626022, acc.: 50.20%] [G loss: 0.359315] [Loss change: -0.004, Loss increases: 2]\n",
      "2100 [D loss: 0.606749, acc.: 50.00%] [G loss: 0.373685] [Loss change: 0.001, Loss increases: 0]\n",
      "2200 [D loss: 0.583658, acc.: 50.20%] [G loss: 0.390994] [Loss change: 0.004, Loss increases: 0]\n",
      "Stoping on iteration:  2295\n",
      "Generated Satan attacks: \n",
      "[[ 1.  0.  0.  0.  0.  0.  9.  0. 41.  1.  0.  0.  0. 22.  8.  0.  0. 15.\n",
      "   0.  0.  0.  0.  3.  0. 31.  0.  0.  0.  3.  3.  0.  7.  0.  6. 11.  0.\n",
      "   0.  0. 23.  0.  0.]\n",
      " [ 0.  5. 71.  0. 20.  0.  0.  4.  0. 29.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0. 23.  0.  0.  5.  0.  5.  0.  0.  0.  3.  1.  0.  0.  0. 14.  0.\n",
      "   0.  0.  0. 13.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  16\n",
      "Attack type: neptune.     number predicted:  65\n",
      "Attack type: normal.     number predicted:  119\n",
      "Attack type: smurf.     number predicted:  34\n",
      "Attack type: teardrop.     number predicted:  22\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [ 16  65 119   0  34  22]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   0   1   1   0   1   0 177   0   0  99   0\n",
      "    0  15   0  85   8   0]\n",
      " [  0   1  40   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   1   1   0   0   1   0 177   0   0  99   0\n",
      "    0  20   1  80   0   0]]\n",
      "0 [D loss: 8.312521, acc.: 32.03%] [G loss: 0.733077] [Loss change: 0.733, Loss increases: 0]\n",
      "100 [D loss: 1.064486, acc.: 50.00%] [G loss: 0.164558] [Loss change: -0.008, Loss increases: 0]\n",
      "200 [D loss: 1.472567, acc.: 50.00%] [G loss: 0.110406] [Loss change: 0.004, Loss increases: 0]\n",
      "300 [D loss: 1.640742, acc.: 50.20%] [G loss: 0.082646] [Loss change: 0.011, Loss increases: 0]\n",
      "400 [D loss: 1.721225, acc.: 50.00%] [G loss: 0.076584] [Loss change: 0.005, Loss increases: 0]\n",
      "Stoping on iteration:  421\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  1.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.\n",
      "   3.  4.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  5.  0.  2.  0.  1.\n",
      "   0.  0.  0.  6.  0.]\n",
      " [ 0.  0.  0.  6.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  1.\n",
      "  11.  9.  3.  0.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  4.  0.  0.\n",
      "   1.  0.  0.  4.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  43\n",
      "Attack type: land.     number predicted:  48\n",
      "Attack type: normal.     number predicted:  34\n",
      "Attack type: portsweep.     number predicted:  3\n",
      "Attack type: smurf.     number predicted:  115\n",
      "Attack type: teardrop.     number predicted:  13\n",
      "\n",
      "[[  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [ 43  48  34   3   0 115  13]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   0   0 100   7   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0  24   0  76   7   0]]\n",
      "0 [D loss: 7.879424, acc.: 42.19%] [G loss: 0.800645] [Loss change: 0.801, Loss increases: 0]\n",
      "100 [D loss: 1.029513, acc.: 50.00%] [G loss: 0.187445] [Loss change: -0.008, Loss increases: 0]\n",
      "200 [D loss: 1.424796, acc.: 50.00%] [G loss: 0.105238] [Loss change: -0.002, Loss increases: 2]\n",
      "300 [D loss: 1.607461, acc.: 50.00%] [G loss: 0.066527] [Loss change: 0.007, Loss increases: 0]\n",
      "400 [D loss: 1.751788, acc.: 50.00%] [G loss: 0.046548] [Loss change: -0.003, Loss increases: 1]\n",
      "500 [D loss: 1.762363, acc.: 50.00%] [G loss: 0.042258] [Loss change: -0.004, Loss increases: 1]\n",
      "600 [D loss: 1.865605, acc.: 50.00%] [G loss: 0.040131] [Loss change: -0.005, Loss increases: 0]\n",
      "700 [D loss: 1.821787, acc.: 50.00%] [G loss: 0.048368] [Loss change: 0.007, Loss increases: 0]\n",
      "800 [D loss: 1.931824, acc.: 50.00%] [G loss: 0.048328] [Loss change: 0.012, Loss increases: 0]\n",
      "900 [D loss: 1.904068, acc.: 50.00%] [G loss: 0.041015] [Loss change: 0.002, Loss increases: 0]\n",
      "1000 [D loss: 1.906349, acc.: 49.80%] [G loss: 0.044364] [Loss change: 0.004, Loss increases: 1]\n",
      "1100 [D loss: 1.886887, acc.: 49.41%] [G loss: 0.039390] [Loss change: 0.001, Loss increases: 0]\n",
      "1200 [D loss: 1.823319, acc.: 49.61%] [G loss: 0.042283] [Loss change: -0.001, Loss increases: 1]\n",
      "1300 [D loss: 1.762237, acc.: 50.00%] [G loss: 0.049639] [Loss change: 0.004, Loss increases: 0]\n",
      "1400 [D loss: 1.745690, acc.: 50.00%] [G loss: 0.049560] [Loss change: 0.003, Loss increases: 0]\n",
      "1500 [D loss: 1.683584, acc.: 50.00%] [G loss: 0.052565] [Loss change: -0.004, Loss increases: 1]\n",
      "1600 [D loss: 1.662348, acc.: 49.80%] [G loss: 0.049763] [Loss change: -0.001, Loss increases: 0]\n",
      "1700 [D loss: 1.662646, acc.: 50.00%] [G loss: 0.050498] [Loss change: -0.008, Loss increases: 1]\n",
      "1800 [D loss: 1.581411, acc.: 50.00%] [G loss: 0.064562] [Loss change: 0.009, Loss increases: 0]\n",
      "Stoping on iteration:  1895\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  6.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 20.  0.  0.  0.  0.  0.  0.  0.  0.  9.  4.  1.  0.  0.\n",
      "   0.  0.  0.  7.  0.]\n",
      " [ 0.  0.  7.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 20.  0.  0.  0.  0.  0.  0.  0.  0. 10.  5.  1.  0.  0.\n",
      "   0.  0.  0.  7.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  16\n",
      "Attack type: neptune.     number predicted:  12\n",
      "Attack type: portsweep.     number predicted:  65\n",
      "Attack type: smurf.     number predicted:  163\n",
      "\n",
      "[[  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [ 16  12  65   0 163]\n",
      " [  0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 176   0   0  99   0\n",
      "    0  33   0  67   8   0]\n",
      " [  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   0   1   1   0   1   0 176   0   0  99   0\n",
      "    0  18   0  82   8   0]]\n",
      "0 [D loss: 0.371389, acc.: 51.76%] [G loss: 0.494892] [Loss change: 0.495, Loss increases: 0]\n",
      "100 [D loss: 0.673945, acc.: 50.00%] [G loss: 0.343989] [Loss change: 0.002, Loss increases: 3]\n",
      "200 [D loss: 0.761659, acc.: 50.00%] [G loss: 0.315988] [Loss change: 0.003, Loss increases: 0]\n",
      "300 [D loss: 0.737693, acc.: 50.00%] [G loss: 0.308584] [Loss change: -0.006, Loss increases: 1]\n",
      "400 [D loss: 0.745024, acc.: 50.20%] [G loss: 0.303780] [Loss change: -0.003, Loss increases: 0]\n",
      "500 [D loss: 0.698085, acc.: 50.00%] [G loss: 0.317003] [Loss change: 0.017, Loss increases: 0]\n",
      "600 [D loss: 0.704756, acc.: 50.78%] [G loss: 0.324898] [Loss change: 0.010, Loss increases: 0]\n",
      "700 [D loss: 0.700559, acc.: 50.39%] [G loss: 0.326033] [Loss change: -0.002, Loss increases: 2]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "800 [D loss: 0.682818, acc.: 50.20%] [G loss: 0.329068] [Loss change: 0.001, Loss increases: 0]\n",
      "900 [D loss: 0.684301, acc.: 50.00%] [G loss: 0.339571] [Loss change: -0.007, Loss increases: 1]\n",
      "1000 [D loss: 0.656273, acc.: 50.78%] [G loss: 0.350469] [Loss change: 0.003, Loss increases: 1]\n",
      "1100 [D loss: 0.653639, acc.: 50.00%] [G loss: 0.357552] [Loss change: -0.008, Loss increases: 2]\n",
      "1200 [D loss: 0.639000, acc.: 50.39%] [G loss: 0.365092] [Loss change: -0.006, Loss increases: 0]\n",
      "1300 [D loss: 0.623285, acc.: 50.59%] [G loss: 0.378878] [Loss change: -0.007, Loss increases: 1]\n",
      "1400 [D loss: 0.604552, acc.: 51.17%] [G loss: 0.399615] [Loss change: 0.001, Loss increases: 0]\n",
      "1500 [D loss: 0.595912, acc.: 51.17%] [G loss: 0.421996] [Loss change: 0.011, Loss increases: 0]\n",
      "1600 [D loss: 0.562286, acc.: 50.78%] [G loss: 0.436677] [Loss change: -0.001, Loss increases: 1]\n",
      "1700 [D loss: 0.552581, acc.: 50.98%] [G loss: 0.445902] [Loss change: -0.007, Loss increases: 1]\n",
      "1800 [D loss: 0.554614, acc.: 51.17%] [G loss: 0.459596] [Loss change: -0.009, Loss increases: 1]\n",
      "1900 [D loss: 0.517230, acc.: 51.17%] [G loss: 0.479719] [Loss change: 0.010, Loss increases: 0]\n",
      "2000 [D loss: 0.499271, acc.: 52.54%] [G loss: 0.502960] [Loss change: 0.002, Loss increases: 0]\n",
      "2100 [D loss: 0.494027, acc.: 52.34%] [G loss: 0.517930] [Loss change: 0.005, Loss increases: 1]\n",
      "2200 [D loss: 0.474220, acc.: 53.52%] [G loss: 0.540540] [Loss change: 0.007, Loss increases: 0]\n",
      "Stoping on iteration:  2265\n",
      "Generated Satan attacks: \n",
      "[[ 0.  1.  2.  0.  0.  0.  0.  0.  0. 21.  1.  0. 22.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0.  0. 28. 16.  0.  1. 11.  0.  0.  0.  0.  0.\n",
      "   4.  1.  0.  6.  0.]\n",
      " [ 5. 16. 23.  0.  0.  0.  0.  0.  0.  0.  0.  0. 23.  0.  0.  0.  4.  0.\n",
      "   1.  0.  0.  0.  0.  0.  0.  0. 12.  0.  1. 11.  1.  5.  0.  0.  1.  0.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: back.     number predicted:  68\n",
      "Attack type: ipsweep.     number predicted:  6\n",
      "Attack type: land.     number predicted:  15\n",
      "Attack type: normal.     number predicted:  160\n",
      "Attack type: warezclient.     number predicted:  7\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [ 68   6  15 160   0   7]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 501   0   0   1   1   0   0   1   0 173   0   0  99   0\n",
      "    0  21   1  79   0   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 501   0   0   0   1   1   0   1   0 173   0   0  99   0\n",
      "    0  10   0  90   6   0]]\n",
      "0 [D loss: 0.375405, acc.: 66.02%] [G loss: 0.647351] [Loss change: 0.647, Loss increases: 0]\n",
      "100 [D loss: 0.572914, acc.: 50.00%] [G loss: 0.428316] [Loss change: 0.007, Loss increases: 0]\n",
      "200 [D loss: 0.622049, acc.: 50.00%] [G loss: 0.377668] [Loss change: -0.008, Loss increases: 0]\n",
      "300 [D loss: 0.633788, acc.: 50.20%] [G loss: 0.366314] [Loss change: 0.001, Loss increases: 1]\n",
      "400 [D loss: 0.634635, acc.: 50.00%] [G loss: 0.363238] [Loss change: -0.005, Loss increases: 1]\n",
      "500 [D loss: 0.631703, acc.: 50.59%] [G loss: 0.367433] [Loss change: -0.001, Loss increases: 1]\n",
      "600 [D loss: 0.622273, acc.: 50.00%] [G loss: 0.370471] [Loss change: 0.002, Loss increases: 0]\n",
      "700 [D loss: 0.629739, acc.: 50.00%] [G loss: 0.367257] [Loss change: -0.001, Loss increases: 0]\n",
      "800 [D loss: 0.608332, acc.: 50.00%] [G loss: 0.379552] [Loss change: -0.000, Loss increases: 0]\n",
      "900 [D loss: 0.580947, acc.: 50.20%] [G loss: 0.396888] [Loss change: 0.003, Loss increases: 0]\n",
      "1000 [D loss: 0.575465, acc.: 50.00%] [G loss: 0.410322] [Loss change: 0.003, Loss increases: 0]\n",
      "1100 [D loss: 0.565689, acc.: 50.20%] [G loss: 0.414777] [Loss change: -0.008, Loss increases: 1]\n",
      "1200 [D loss: 0.548055, acc.: 50.39%] [G loss: 0.433412] [Loss change: -0.000, Loss increases: 0]\n",
      "1300 [D loss: 0.529959, acc.: 50.98%] [G loss: 0.448138] [Loss change: 0.004, Loss increases: 0]\n",
      "1400 [D loss: 0.522065, acc.: 50.00%] [G loss: 0.459390] [Loss change: -0.006, Loss increases: 0]\n",
      "1500 [D loss: 0.509185, acc.: 50.59%] [G loss: 0.482941] [Loss change: -0.001, Loss increases: 2]\n",
      "1600 [D loss: 0.489100, acc.: 50.98%] [G loss: 0.498426] [Loss change: -0.004, Loss increases: 2]\n",
      "1700 [D loss: 0.475466, acc.: 50.39%] [G loss: 0.510130] [Loss change: -0.002, Loss increases: 0]\n",
      "1800 [D loss: 0.466193, acc.: 51.56%] [G loss: 0.531822] [Loss change: 0.006, Loss increases: 0]\n",
      "1900 [D loss: 0.453146, acc.: 51.95%] [G loss: 0.544219] [Loss change: -0.002, Loss increases: 0]\n",
      "2000 [D loss: 0.433850, acc.: 52.73%] [G loss: 0.569570] [Loss change: 0.009, Loss increases: 0]\n",
      "2100 [D loss: 0.427824, acc.: 52.93%] [G loss: 0.583403] [Loss change: -0.003, Loss increases: 0]\n",
      "2200 [D loss: 0.414052, acc.: 55.66%] [G loss: 0.599985] [Loss change: -0.002, Loss increases: 0]\n",
      "2300 [D loss: 0.400193, acc.: 57.42%] [G loss: 0.616396] [Loss change: -0.003, Loss increases: 0]\n",
      "2400 [D loss: 0.415772, acc.: 58.59%] [G loss: 0.599883] [Loss change: -0.019, Loss increases: 2]\n",
      "2500 [D loss: 0.400444, acc.: 61.33%] [G loss: 0.628103] [Loss change: 0.005, Loss increases: 0]\n",
      "2600 [D loss: 0.395428, acc.: 63.09%] [G loss: 0.639315] [Loss change: 0.001, Loss increases: 3]\n",
      "2700 [D loss: 0.396979, acc.: 65.04%] [G loss: 0.646307] [Loss change: -0.005, Loss increases: 0]\n",
      "2800 [D loss: 0.375412, acc.: 69.53%] [G loss: 0.674163] [Loss change: 0.006, Loss increases: 1]\n",
      "Stoping on iteration:  2873\n",
      "Generated Satan attacks: \n",
      "[[ 0.  4.  0.  0.  0.  4.  0. 12.  0.  0.  0.  0. 10.  0.  0.  0.  0.  0.\n",
      "   0.  0. 15.  0.  2.  4.  0.  0.  0.  3.  0.  0.  0. 29.  0.  0. 40.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0.  7.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  3.  0.  0.  0.  0. 29.  0. 23.\n",
      "   0.  2.  0.  0.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  76\n",
      "Attack type: land.     number predicted:  6\n",
      "Attack type: nmap.     number predicted:  25\n",
      "Attack type: normal.     number predicted:  17\n",
      "Attack type: smurf.     number predicted:  57\n",
      "Attack type: teardrop.     number predicted:  42\n",
      "Attack type: warezclient.     number predicted:  33\n",
      "\n",
      "[[ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [76  6 25 17  0 57 42 33]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   2  40   6   1   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   6   1   0   0   0   0   0   0   0 178   1   1  23 100\n",
      "    0   0   0   0   0   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   4   0  96   8   0]]\n",
      "0 [D loss: 8.087831, acc.: 49.41%] [G loss: 0.843027] [Loss change: 0.843, Loss increases: 0]\n",
      "100 [D loss: 0.880221, acc.: 50.20%] [G loss: 0.239952] [Loss change: -0.018, Loss increases: 1]\n",
      "200 [D loss: 1.371941, acc.: 50.00%] [G loss: 0.105696] [Loss change: -0.004, Loss increases: 2]\n",
      "300 [D loss: 1.632815, acc.: 50.00%] [G loss: 0.064000] [Loss change: 0.005, Loss increases: 0]\n",
      "400 [D loss: 1.793136, acc.: 49.41%] [G loss: 0.049836] [Loss change: -0.002, Loss increases: 2]\n",
      "500 [D loss: 1.767412, acc.: 49.80%] [G loss: 0.044258] [Loss change: 0.004, Loss increases: 0]\n",
      "600 [D loss: 1.786322, acc.: 50.00%] [G loss: 0.041941] [Loss change: 0.000, Loss increases: 0]\n",
      "700 [D loss: 1.732079, acc.: 50.00%] [G loss: 0.049227] [Loss change: 0.008, Loss increases: 1]\n",
      "800 [D loss: 1.777318, acc.: 50.00%] [G loss: 0.038382] [Loss change: -0.005, Loss increases: 2]\n",
      "900 [D loss: 1.730406, acc.: 49.80%] [G loss: 0.048457] [Loss change: 0.001, Loss increases: 1]\n",
      "1000 [D loss: 1.685753, acc.: 49.80%] [G loss: 0.050632] [Loss change: 0.002, Loss increases: 1]\n",
      "1100 [D loss: 1.668128, acc.: 50.00%] [G loss: 0.048192] [Loss change: -0.003, Loss increases: 1]\n",
      "1200 [D loss: 1.627952, acc.: 50.00%] [G loss: 0.048980] [Loss change: -0.007, Loss increases: 0]\n",
      "1300 [D loss: 1.613742, acc.: 50.00%] [G loss: 0.054137] [Loss change: -0.001, Loss increases: 1]\n",
      "1400 [D loss: 1.566365, acc.: 50.00%] [G loss: 0.062915] [Loss change: -0.000, Loss increases: 1]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1500 [D loss: 1.563299, acc.: 50.00%] [G loss: 0.058032] [Loss change: -0.004, Loss increases: 0]\n",
      "1600 [D loss: 1.599274, acc.: 50.00%] [G loss: 0.054792] [Loss change: -0.003, Loss increases: 1]\n",
      "1700 [D loss: 1.568897, acc.: 50.00%] [G loss: 0.058651] [Loss change: 0.000, Loss increases: 0]\n",
      "1800 [D loss: 1.537568, acc.: 50.00%] [G loss: 0.064583] [Loss change: -0.004, Loss increases: 1]\n",
      "1900 [D loss: 1.495858, acc.: 50.00%] [G loss: 0.074165] [Loss change: 0.005, Loss increases: 2]\n",
      "2000 [D loss: 1.474576, acc.: 50.00%] [G loss: 0.072926] [Loss change: 0.004, Loss increases: 1]\n",
      "2100 [D loss: 1.554901, acc.: 50.00%] [G loss: 0.072305] [Loss change: -0.010, Loss increases: 2]\n",
      "2200 [D loss: 1.480748, acc.: 50.00%] [G loss: 0.077319] [Loss change: -0.007, Loss increases: 1]\n",
      "2300 [D loss: 1.434819, acc.: 50.00%] [G loss: 0.087056] [Loss change: -0.000, Loss increases: 2]\n",
      "2400 [D loss: 1.413068, acc.: 50.00%] [G loss: 0.089877] [Loss change: 0.005, Loss increases: 2]\n",
      "2500 [D loss: 1.381271, acc.: 50.00%] [G loss: 0.096888] [Loss change: 0.002, Loss increases: 0]\n",
      "2600 [D loss: 1.386259, acc.: 50.00%] [G loss: 0.095594] [Loss change: 0.003, Loss increases: 0]\n",
      "2700 [D loss: 1.365552, acc.: 50.00%] [G loss: 0.097242] [Loss change: -0.001, Loss increases: 2]\n",
      "2800 [D loss: 1.337972, acc.: 50.00%] [G loss: 0.105459] [Loss change: 0.001, Loss increases: 0]\n",
      "2900 [D loss: 1.320689, acc.: 49.80%] [G loss: 0.109849] [Loss change: -0.002, Loss increases: 2]\n",
      "3000 [D loss: 1.313347, acc.: 50.00%] [G loss: 0.118565] [Loss change: -0.002, Loss increases: 2]\n",
      "3100 [D loss: 1.269997, acc.: 50.00%] [G loss: 0.123293] [Loss change: 0.003, Loss increases: 0]\n",
      "3200 [D loss: 1.335977, acc.: 50.00%] [G loss: 0.127721] [Loss change: 0.007, Loss increases: 0]\n",
      "3300 [D loss: 1.293343, acc.: 50.00%] [G loss: 0.131989] [Loss change: 0.005, Loss increases: 1]\n",
      "3400 [D loss: 1.262315, acc.: 50.00%] [G loss: 0.146734] [Loss change: 0.004, Loss increases: 1]\n",
      "3500 [D loss: 1.364118, acc.: 50.00%] [G loss: 0.152053] [Loss change: 0.002, Loss increases: 0]\n",
      "3600 [D loss: 1.357073, acc.: 50.00%] [G loss: 0.180987] [Loss change: 0.002, Loss increases: 1]\n",
      "3700 [D loss: 1.358842, acc.: 50.00%] [G loss: 0.160599] [Loss change: -0.007, Loss increases: 3]\n",
      "3800 [D loss: 1.337674, acc.: 49.80%] [G loss: 0.172308] [Loss change: 0.007, Loss increases: 0]\n",
      "3900 [D loss: 1.382015, acc.: 50.00%] [G loss: 0.174490] [Loss change: -0.002, Loss increases: 0]\n",
      "4000 [D loss: 1.289325, acc.: 49.80%] [G loss: 0.198216] [Loss change: 0.003, Loss increases: 2]\n",
      "4100 [D loss: 1.304973, acc.: 50.00%] [G loss: 0.197763] [Loss change: 0.003, Loss increases: 0]\n",
      "4200 [D loss: 1.306248, acc.: 49.61%] [G loss: 0.199438] [Loss change: -0.019, Loss increases: 2]\n",
      "4300 [D loss: 1.267873, acc.: 49.80%] [G loss: 0.205886] [Loss change: 0.003, Loss increases: 0]\n",
      "4400 [D loss: 1.254249, acc.: 50.00%] [G loss: 0.232404] [Loss change: 0.010, Loss increases: 1]\n",
      "4500 [D loss: 1.216273, acc.: 49.41%] [G loss: 0.243327] [Loss change: 0.009, Loss increases: 0]\n",
      "4600 [D loss: 1.213581, acc.: 49.41%] [G loss: 0.235503] [Loss change: -0.020, Loss increases: 1]\n",
      "4700 [D loss: 1.223761, acc.: 49.22%] [G loss: 0.275319] [Loss change: 0.026, Loss increases: 0]\n",
      "4800 [D loss: 1.168797, acc.: 49.02%] [G loss: 0.262484] [Loss change: 0.008, Loss increases: 0]\n",
      "4900 [D loss: 1.162031, acc.: 49.41%] [G loss: 0.271233] [Loss change: -0.001, Loss increases: 0]\n",
      "5000 [D loss: 1.102318, acc.: 50.20%] [G loss: 0.277670] [Loss change: -0.004, Loss increases: 0]\n",
      "5100 [D loss: 1.036390, acc.: 50.78%] [G loss: 0.279569] [Loss change: -0.018, Loss increases: 2]\n",
      "5200 [D loss: 1.220430, acc.: 48.63%] [G loss: 0.250782] [Loss change: -0.005, Loss increases: 0]\n",
      "5300 [D loss: 1.017554, acc.: 49.41%] [G loss: 0.293308] [Loss change: 0.007, Loss increases: 1]\n",
      "5400 [D loss: 1.137280, acc.: 49.41%] [G loss: 0.326991] [Loss change: 0.007, Loss increases: 1]\n",
      "5500 [D loss: 1.017979, acc.: 49.41%] [G loss: 0.328797] [Loss change: 0.020, Loss increases: 1]\n",
      "5600 [D loss: 1.017284, acc.: 48.05%] [G loss: 0.299581] [Loss change: -0.062, Loss increases: 3]\n",
      "5700 [D loss: 0.938803, acc.: 49.80%] [G loss: 0.352960] [Loss change: 0.013, Loss increases: 0]\n",
      "5800 [D loss: 0.921829, acc.: 49.02%] [G loss: 0.367271] [Loss change: 0.011, Loss increases: 1]\n",
      "5900 [D loss: 0.854724, acc.: 49.80%] [G loss: 0.365526] [Loss change: 0.000, Loss increases: 0]\n",
      "6000 [D loss: 0.794779, acc.: 50.00%] [G loss: 0.396904] [Loss change: 0.032, Loss increases: 0]\n",
      "6100 [D loss: 0.754428, acc.: 50.00%] [G loss: 0.412283] [Loss change: 0.032, Loss increases: 0]\n",
      "6200 [D loss: 0.797018, acc.: 49.80%] [G loss: 0.443597] [Loss change: 0.032, Loss increases: 0]\n",
      "6300 [D loss: 0.759175, acc.: 50.20%] [G loss: 0.448228] [Loss change: -0.040, Loss increases: 2]\n",
      "6400 [D loss: 0.806331, acc.: 50.00%] [G loss: 0.469597] [Loss change: -0.050, Loss increases: 3]\n",
      "6500 [D loss: 0.969507, acc.: 49.80%] [G loss: 0.505105] [Loss change: 0.029, Loss increases: 1]\n",
      "6600 [D loss: 0.901524, acc.: 50.59%] [G loss: 0.476584] [Loss change: -0.124, Loss increases: 3]\n",
      "6700 [D loss: 0.766375, acc.: 50.39%] [G loss: 0.551887] [Loss change: 0.040, Loss increases: 0]\n",
      "6800 [D loss: 0.862761, acc.: 49.22%] [G loss: 0.471986] [Loss change: -0.040, Loss increases: 1]\n",
      "6900 [D loss: 0.749354, acc.: 50.59%] [G loss: 0.512668] [Loss change: -0.036, Loss increases: 1]\n",
      "Generated Satan attacks: \n",
      "[[12.  0. 22.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 79.  0.  0.  0.  0.  1.  0.  0.  0. 75.  0.  0.  0.  0.\n",
      "   0.  0.  0. 80.  0.]\n",
      " [ 0.  0.  0.  0.  6.  0.  0.  0.  0. 11.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 31.  0.  0.  0. 53.  0.  0.  0.  0.  0.  0.  0. 24. 37.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  7\n",
      "Attack type: neptune.     number predicted:  125\n",
      "Attack type: portsweep.     number predicted:  17\n",
      "Attack type: satan.     number predicted:  6\n",
      "Attack type: smurf.     number predicted:  14\n",
      "Attack type: teardrop.     number predicted:  87\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  7 125  17   6  14  87]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0234375\n",
      "Real satan attacks:\n",
      "[[  0   1  38   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 166   0   0  99   0\n",
      "    0  11   0  87   6   0]\n",
      " [  0   1  19   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 471  17   0   0   1   1   0   1   0 166  16   7  93   0\n",
      "    0   8   0  92   6   0]]\n",
      "0 [D loss: 0.396488, acc.: 50.00%] [G loss: 0.466396] [Loss change: 0.466, Loss increases: 0]\n",
      "100 [D loss: 0.759184, acc.: 50.00%] [G loss: 0.303675] [Loss change: 0.011, Loss increases: 0]\n",
      "200 [D loss: 0.759206, acc.: 50.00%] [G loss: 0.282606] [Loss change: -0.005, Loss increases: 1]\n",
      "300 [D loss: 0.820342, acc.: 50.00%] [G loss: 0.270756] [Loss change: -0.008, Loss increases: 3]\n",
      "400 [D loss: 0.769460, acc.: 50.00%] [G loss: 0.286253] [Loss change: 0.001, Loss increases: 1]\n",
      "500 [D loss: 0.778429, acc.: 50.00%] [G loss: 0.276086] [Loss change: -0.010, Loss increases: 2]\n",
      "Stoping on iteration:  572\n",
      "Generated Satan attacks: \n",
      "[[ 2.  1.  3.  0.  1.  0.  0.  0.  3.  0.  0.  0.  0.  7.  0.  0.  0.  0.\n",
      "   1.  6.  0.  0.  0.  0.  0.  4.  3.  0.  0.  0.  0.  6.  0.  0.  3.  0.\n",
      "   4.  0.  3.  0.  0.]\n",
      " [ 0.  0. 10.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.\n",
      "   3. 15.  0.  2.  0.  1.  0.  0.  0.  0.  0.  3.  0. 21.  0.  0.  3.  7.\n",
      "   5.  3.  4.  4.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  22\n",
      "Attack type: land.     number predicted:  8\n",
      "Attack type: neptune.     number predicted:  19\n",
      "Attack type: normal.     number predicted:  158\n",
      "Attack type: portsweep.     number predicted:  1\n",
      "Attack type: smurf.     number predicted:  24\n",
      "Attack type: teardrop.     number predicted:  21\n",
      "Attack type: warezclient.     number predicted:  3\n",
      "\n",
      "[[  0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0]\n",
      " [ 22   8  19 158   1   0  24  21   3]\n",
      " [  0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 169   0   0  99   0\n",
      "    0   0   0 100   8   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 169   0   0  99   0\n",
      "    0   0   0 100   8   0]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 [D loss: 0.435128, acc.: 74.41%] [G loss: 0.691770] [Loss change: 0.692, Loss increases: 0]\n",
      "100 [D loss: 0.610930, acc.: 50.78%] [G loss: 0.388311] [Loss change: 0.003, Loss increases: 0]\n",
      "200 [D loss: 0.690897, acc.: 50.20%] [G loss: 0.327637] [Loss change: -0.007, Loss increases: 2]\n",
      "300 [D loss: 0.709825, acc.: 50.00%] [G loss: 0.321772] [Loss change: 0.002, Loss increases: 0]\n",
      "400 [D loss: 0.725519, acc.: 50.00%] [G loss: 0.308988] [Loss change: -0.003, Loss increases: 0]\n",
      "500 [D loss: 0.695804, acc.: 50.00%] [G loss: 0.312167] [Loss change: 0.000, Loss increases: 1]\n",
      "600 [D loss: 0.689930, acc.: 50.00%] [G loss: 0.314064] [Loss change: -0.001, Loss increases: 0]\n",
      "700 [D loss: 0.703520, acc.: 50.20%] [G loss: 0.315655] [Loss change: -0.002, Loss increases: 0]\n",
      "800 [D loss: 0.659368, acc.: 50.00%] [G loss: 0.333002] [Loss change: 0.008, Loss increases: 3]\n",
      "900 [D loss: 0.669419, acc.: 50.00%] [G loss: 0.332494] [Loss change: -0.008, Loss increases: 1]\n",
      "1000 [D loss: 0.657552, acc.: 50.20%] [G loss: 0.343514] [Loss change: -0.001, Loss increases: 0]\n",
      "1100 [D loss: 0.671766, acc.: 50.00%] [G loss: 0.338487] [Loss change: -0.012, Loss increases: 1]\n",
      "1200 [D loss: 0.645901, acc.: 50.20%] [G loss: 0.359366] [Loss change: 0.003, Loss increases: 0]\n",
      "1300 [D loss: 0.635622, acc.: 50.39%] [G loss: 0.360272] [Loss change: -0.003, Loss increases: 0]\n",
      "1400 [D loss: 0.616407, acc.: 50.39%] [G loss: 0.384591] [Loss change: 0.007, Loss increases: 0]\n",
      "1500 [D loss: 0.595199, acc.: 50.39%] [G loss: 0.393346] [Loss change: 0.005, Loss increases: 0]\n",
      "Stoping on iteration:  1543\n",
      "Generated Satan attacks: \n",
      "[[ 0.  6.  0.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  5.  0.  0.  1.  0.  0.  2.  0.  0.  4.  0.  3.  3.  3.\n",
      "   7.  0.  1.  0.  0.]\n",
      " [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 25.  0.  0.  2.  0.  0. 11.  0.  0. 25.  0.  3.  5.  1.\n",
      "  15.  0.  3.  5.  1.]]\n",
      "Attack type: ipsweep.     number predicted:  71\n",
      "Attack type: land.     number predicted:  15\n",
      "Attack type: neptune.     number predicted:  91\n",
      "Attack type: nmap.     number predicted:  8\n",
      "Attack type: normal.     number predicted:  13\n",
      "Attack type: portsweep.     number predicted:  3\n",
      "Attack type: satan.     number predicted:  1\n",
      "Attack type: smurf.     number predicted:  19\n",
      "Attack type: teardrop.     number predicted:  35\n",
      "\n",
      "[[ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [71 15 91  8 13  3  1 19 35]\n",
      " [ 0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.00390625\n",
      "Real satan attacks:\n",
      "[[  0   2  46   6   1   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0   4   2   0   0   0   0   1   1   0 172   2   1  35  83\n",
      "    0   0   0  16   0   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 490   0   0   0   1   1   0   1   0 172   0   0  90   0\n",
      "    0   8   0  92   8   0]]\n",
      "0 [D loss: 8.290836, acc.: 50.00%] [G loss: 1.078983] [Loss change: 1.079, Loss increases: 0]\n",
      "100 [D loss: 0.575080, acc.: 50.20%] [G loss: 0.416540] [Loss change: -0.001, Loss increases: 0]\n",
      "200 [D loss: 1.017184, acc.: 50.00%] [G loss: 0.209344] [Loss change: 0.000, Loss increases: 2]\n",
      "300 [D loss: 1.250266, acc.: 50.00%] [G loss: 0.122257] [Loss change: 0.004, Loss increases: 0]\n",
      "400 [D loss: 1.430600, acc.: 50.00%] [G loss: 0.088657] [Loss change: 0.005, Loss increases: 0]\n",
      "500 [D loss: 1.523678, acc.: 49.61%] [G loss: 0.075912] [Loss change: 0.002, Loss increases: 0]\n",
      "600 [D loss: 1.504582, acc.: 50.00%] [G loss: 0.075587] [Loss change: -0.003, Loss increases: 0]\n",
      "700 [D loss: 1.495038, acc.: 50.00%] [G loss: 0.069278] [Loss change: -0.006, Loss increases: 1]\n",
      "800 [D loss: 1.463364, acc.: 50.00%] [G loss: 0.077529] [Loss change: 0.005, Loss increases: 0]\n",
      "900 [D loss: 1.475905, acc.: 50.00%] [G loss: 0.071774] [Loss change: -0.004, Loss increases: 0]\n",
      "1000 [D loss: 1.460990, acc.: 50.00%] [G loss: 0.076316] [Loss change: 0.002, Loss increases: 1]\n",
      "1100 [D loss: 1.459584, acc.: 50.00%] [G loss: 0.079603] [Loss change: 0.000, Loss increases: 0]\n",
      "1200 [D loss: 1.449859, acc.: 50.00%] [G loss: 0.081154] [Loss change: 0.001, Loss increases: 0]\n",
      "1300 [D loss: 1.418960, acc.: 50.00%] [G loss: 0.084586] [Loss change: -0.002, Loss increases: 0]\n",
      "1400 [D loss: 1.387163, acc.: 50.00%] [G loss: 0.090839] [Loss change: 0.001, Loss increases: 1]\n",
      "1500 [D loss: 1.361784, acc.: 50.00%] [G loss: 0.092907] [Loss change: -0.008, Loss increases: 1]\n",
      "1600 [D loss: 1.378491, acc.: 50.00%] [G loss: 0.101594] [Loss change: 0.009, Loss increases: 0]\n",
      "1700 [D loss: 1.318001, acc.: 50.00%] [G loss: 0.099685] [Loss change: -0.001, Loss increases: 1]\n",
      "1800 [D loss: 1.253278, acc.: 50.00%] [G loss: 0.107211] [Loss change: 0.011, Loss increases: 0]\n",
      "Stoping on iteration:  1892\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 40.  0.  0.  0.  0.  0.  0.  0.  0. 21.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0. 68.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0. 24. 39.\n",
      "   0.  0.  0. 16.  0.]]\n",
      "Attack type: neptune.     number predicted:  10\n",
      "Attack type: smurf.     number predicted:  2\n",
      "Attack type: teardrop.     number predicted:  244\n",
      "\n",
      "[[  0   0   0   0]\n",
      " [ 10   0   2 244]\n",
      " [  0   0   0   0]\n",
      " [  0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   2  46   6   1   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0  21   1   0   0   0   0   0   0   0 178   1   1  64  46\n",
      "    0   0   0  54   0   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0  32   0  68   8   0]]\n",
      "0 [D loss: 7.949045, acc.: 17.77%] [G loss: 0.666816] [Loss change: 0.667, Loss increases: 0]\n",
      "100 [D loss: 0.854174, acc.: 50.00%] [G loss: 0.246320] [Loss change: -0.007, Loss increases: 0]\n",
      "200 [D loss: 1.292461, acc.: 50.00%] [G loss: 0.139143] [Loss change: -0.001, Loss increases: 2]\n",
      "300 [D loss: 1.512065, acc.: 50.00%] [G loss: 0.101471] [Loss change: 0.002, Loss increases: 1]\n",
      "400 [D loss: 1.612921, acc.: 50.00%] [G loss: 0.079914] [Loss change: 0.007, Loss increases: 1]\n",
      "500 [D loss: 1.706911, acc.: 50.00%] [G loss: 0.059539] [Loss change: -0.005, Loss increases: 0]\n",
      "600 [D loss: 1.829654, acc.: 50.00%] [G loss: 0.047927] [Loss change: 0.005, Loss increases: 0]\n",
      "700 [D loss: 1.795573, acc.: 50.00%] [G loss: 0.043613] [Loss change: 0.001, Loss increases: 0]\n",
      "800 [D loss: 1.750299, acc.: 49.80%] [G loss: 0.043616] [Loss change: 0.000, Loss increases: 0]\n",
      "900 [D loss: 1.686903, acc.: 50.00%] [G loss: 0.048364] [Loss change: 0.003, Loss increases: 1]\n",
      "1000 [D loss: 1.642205, acc.: 50.00%] [G loss: 0.050029] [Loss change: 0.004, Loss increases: 0]\n",
      "1100 [D loss: 1.652282, acc.: 50.00%] [G loss: 0.051838] [Loss change: -0.002, Loss increases: 2]\n",
      "1200 [D loss: 1.631222, acc.: 50.00%] [G loss: 0.049899] [Loss change: -0.005, Loss increases: 0]\n",
      "1300 [D loss: 1.614235, acc.: 50.00%] [G loss: 0.055618] [Loss change: -0.001, Loss increases: 0]\n",
      "1400 [D loss: 1.574059, acc.: 50.00%] [G loss: 0.056736] [Loss change: 0.003, Loss increases: 0]\n",
      "1500 [D loss: 1.511348, acc.: 50.00%] [G loss: 0.066075] [Loss change: 0.001, Loss increases: 2]\n",
      "1600 [D loss: 1.535949, acc.: 50.00%] [G loss: 0.066327] [Loss change: 0.001, Loss increases: 0]\n",
      "1700 [D loss: 1.553732, acc.: 50.00%] [G loss: 0.071450] [Loss change: 0.000, Loss increases: 0]\n",
      "1800 [D loss: 1.551972, acc.: 50.00%] [G loss: 0.068294] [Loss change: -0.003, Loss increases: 2]\n",
      "1900 [D loss: 1.540905, acc.: 50.00%] [G loss: 0.076737] [Loss change: 0.001, Loss increases: 2]\n",
      "2000 [D loss: 1.506584, acc.: 50.00%] [G loss: 0.075188] [Loss change: 0.003, Loss increases: 0]\n",
      "2100 [D loss: 1.580081, acc.: 50.00%] [G loss: 0.082001] [Loss change: -0.016, Loss increases: 0]\n",
      "2200 [D loss: 1.504761, acc.: 50.00%] [G loss: 0.090292] [Loss change: -0.004, Loss increases: 1]\n",
      "2300 [D loss: 1.471340, acc.: 50.00%] [G loss: 0.092402] [Loss change: 0.002, Loss increases: 0]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2400 [D loss: 1.441136, acc.: 50.00%] [G loss: 0.104598] [Loss change: 0.006, Loss increases: 1]\n",
      "2500 [D loss: 1.459824, acc.: 50.00%] [G loss: 0.111845] [Loss change: 0.009, Loss increases: 1]\n",
      "2600 [D loss: 1.411238, acc.: 50.00%] [G loss: 0.111103] [Loss change: 0.000, Loss increases: 0]\n",
      "2700 [D loss: 1.384888, acc.: 50.00%] [G loss: 0.122027] [Loss change: 0.009, Loss increases: 1]\n",
      "2800 [D loss: 1.370458, acc.: 50.00%] [G loss: 0.122154] [Loss change: -0.003, Loss increases: 1]\n",
      "2900 [D loss: 1.341151, acc.: 50.00%] [G loss: 0.125473] [Loss change: -0.004, Loss increases: 0]\n",
      "3000 [D loss: 1.331133, acc.: 50.00%] [G loss: 0.140504] [Loss change: 0.003, Loss increases: 1]\n",
      "3100 [D loss: 1.321981, acc.: 50.00%] [G loss: 0.135253] [Loss change: -0.005, Loss increases: 3]\n",
      "3200 [D loss: 1.471070, acc.: 49.02%] [G loss: 0.129388] [Loss change: -0.007, Loss increases: 1]\n",
      "3300 [D loss: 1.458639, acc.: 49.41%] [G loss: 0.137317] [Loss change: 0.008, Loss increases: 2]\n",
      "3400 [D loss: 1.506191, acc.: 48.44%] [G loss: 0.138456] [Loss change: 0.002, Loss increases: 2]\n",
      "3500 [D loss: 1.398967, acc.: 49.22%] [G loss: 0.145992] [Loss change: 0.003, Loss increases: 1]\n",
      "3600 [D loss: 1.370381, acc.: 49.22%] [G loss: 0.145908] [Loss change: 0.012, Loss increases: 0]\n",
      "3700 [D loss: 1.358956, acc.: 49.22%] [G loss: 0.142265] [Loss change: 0.004, Loss increases: 0]\n",
      "3800 [D loss: 1.367744, acc.: 48.63%] [G loss: 0.156046] [Loss change: 0.011, Loss increases: 0]\n",
      "3900 [D loss: 1.332736, acc.: 49.61%] [G loss: 0.142438] [Loss change: -0.005, Loss increases: 0]\n",
      "4000 [D loss: 1.397186, acc.: 49.02%] [G loss: 0.145213] [Loss change: -0.013, Loss increases: 1]\n",
      "Stoping on iteration:  4083\n",
      "Generated Satan attacks: \n",
      "[[ 0.  6. 14.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 76. 11.  0.  0.  0.  0.  0.  4.  0. 19.  0.  0.  5.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0.  0.  0. 15.  2.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   7.  0.  0.  0.  0.  0.  0.  0.  0.  0.  4.  0.  0.  3.  0.  0.  0. 22.\n",
      "   0.  0.  0.  6. 18.]]\n",
      "Attack type: neptune.     number predicted:  4\n",
      "Attack type: nmap.     number predicted:  98\n",
      "Attack type: portsweep.     number predicted:  15\n",
      "Attack type: teardrop.     number predicted:  97\n",
      "Attack type: warezclient.     number predicted:  42\n",
      "\n",
      "[[ 0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0]\n",
      " [ 4 98 15  0 97 42]\n",
      " [ 0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 391   0   0   0   1   1   0   1   0 175   0   0  99   0\n",
      "    0   9   0  91   8   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 175   0   0  99   0\n",
      "    0  11   0  89   8   0]]\n",
      "0 [D loss: 0.392736, acc.: 50.00%] [G loss: 0.533219] [Loss change: 0.533, Loss increases: 0]\n",
      "100 [D loss: 0.607434, acc.: 50.00%] [G loss: 0.393758] [Loss change: 0.004, Loss increases: 0]\n",
      "200 [D loss: 0.652701, acc.: 50.00%] [G loss: 0.349344] [Loss change: 0.006, Loss increases: 0]\n",
      "300 [D loss: 0.689267, acc.: 50.20%] [G loss: 0.329052] [Loss change: 0.002, Loss increases: 0]\n",
      "400 [D loss: 0.671859, acc.: 50.00%] [G loss: 0.331139] [Loss change: -0.000, Loss increases: 1]\n",
      "500 [D loss: 0.689228, acc.: 50.59%] [G loss: 0.334769] [Loss change: 0.002, Loss increases: 2]\n",
      "600 [D loss: 0.684597, acc.: 50.00%] [G loss: 0.333080] [Loss change: -0.005, Loss increases: 1]\n",
      "700 [D loss: 0.677676, acc.: 50.00%] [G loss: 0.340780] [Loss change: -0.001, Loss increases: 0]\n",
      "800 [D loss: 0.645661, acc.: 50.00%] [G loss: 0.353660] [Loss change: -0.000, Loss increases: 1]\n",
      "900 [D loss: 0.639045, acc.: 50.59%] [G loss: 0.366685] [Loss change: 0.004, Loss increases: 0]\n",
      "1000 [D loss: 0.597158, acc.: 50.20%] [G loss: 0.379520] [Loss change: 0.004, Loss increases: 0]\n",
      "1100 [D loss: 0.590706, acc.: 50.20%] [G loss: 0.394487] [Loss change: -0.000, Loss increases: 0]\n",
      "1200 [D loss: 0.586592, acc.: 50.59%] [G loss: 0.400416] [Loss change: -0.007, Loss increases: 1]\n",
      "1300 [D loss: 0.573689, acc.: 50.59%] [G loss: 0.412497] [Loss change: 0.003, Loss increases: 1]\n",
      "1400 [D loss: 0.560684, acc.: 50.00%] [G loss: 0.420034] [Loss change: -0.003, Loss increases: 0]\n",
      "1500 [D loss: 0.542167, acc.: 50.00%] [G loss: 0.436122] [Loss change: -0.003, Loss increases: 0]\n",
      "1600 [D loss: 0.519366, acc.: 50.78%] [G loss: 0.459588] [Loss change: 0.006, Loss increases: 1]\n",
      "Stoping on iteration:  1612\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  1.  0.  0.  0. 13.  0.  0.  0.  9.  0. 25. 12.  0.\n",
      "  10.  6.  0.  0.  9.  0.  0.  0.  0.  0. 24.  8. 19.  0. 17.  0.  0. 18.\n",
      "   0. 25.  0.  0.  7.]\n",
      " [ 0.  0.  0.  0.  3.  0.  0.  3.  1.  0.  6.  0.  0. 14.  0.  6.  0.  5.\n",
      "  12.  5.  0. 19.  0.  0.  0.  0.  0.  0. 15.  0. 17.  0. 13.  2.  0.  0.\n",
      "   0. 15.  0.  0.  6.]]\n",
      "Attack type: land.     number predicted:  7\n",
      "Attack type: nmap.     number predicted:  16\n",
      "Attack type: normal.     number predicted:  115\n",
      "Attack type: smurf.     number predicted:  18\n",
      "Attack type: teardrop.     number predicted:  17\n",
      "Attack type: warezclient.     number predicted:  83\n",
      "\n",
      "[[  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  7  16 115   0  18  17  83]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   3   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 509   0   0   1   1   0   0   1   0 182   0   0  99   0\n",
      "    0  22   1  78   0   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 182   0   0  99   0\n",
      "    0   9   0  91   8   0]]\n",
      "0 [D loss: 7.737985, acc.: 34.77%] [G loss: 0.695223] [Loss change: 0.695, Loss increases: 0]\n",
      "100 [D loss: 0.934800, acc.: 50.00%] [G loss: 0.216863] [Loss change: 0.005, Loss increases: 0]\n",
      "200 [D loss: 1.328277, acc.: 50.00%] [G loss: 0.135216] [Loss change: -0.005, Loss increases: 2]\n",
      "300 [D loss: 1.518311, acc.: 50.20%] [G loss: 0.091343] [Loss change: -0.008, Loss increases: 0]\n",
      "400 [D loss: 1.868372, acc.: 50.00%] [G loss: 0.068915] [Loss change: 0.007, Loss increases: 0]\n",
      "500 [D loss: 1.895950, acc.: 50.00%] [G loss: 0.049681] [Loss change: -0.002, Loss increases: 1]\n",
      "600 [D loss: 1.902808, acc.: 50.00%] [G loss: 0.046488] [Loss change: -0.004, Loss increases: 0]\n",
      "700 [D loss: 1.943826, acc.: 50.00%] [G loss: 0.039531] [Loss change: -0.009, Loss increases: 1]\n",
      "800 [D loss: 1.934811, acc.: 49.41%] [G loss: 0.033826] [Loss change: -0.005, Loss increases: 1]\n",
      "900 [D loss: 1.868593, acc.: 50.00%] [G loss: 0.038657] [Loss change: 0.007, Loss increases: 0]\n",
      "1000 [D loss: 1.900548, acc.: 49.80%] [G loss: 0.038362] [Loss change: 0.003, Loss increases: 1]\n",
      "1100 [D loss: 1.876513, acc.: 49.41%] [G loss: 0.035350] [Loss change: 0.000, Loss increases: 1]\n",
      "1200 [D loss: 1.860397, acc.: 49.61%] [G loss: 0.035129] [Loss change: -0.003, Loss increases: 1]\n",
      "1300 [D loss: 1.847402, acc.: 49.80%] [G loss: 0.037915] [Loss change: -0.001, Loss increases: 1]\n",
      "1400 [D loss: 1.772127, acc.: 50.00%] [G loss: 0.039278] [Loss change: 0.000, Loss increases: 0]\n",
      "1500 [D loss: 1.799115, acc.: 50.00%] [G loss: 0.040844] [Loss change: 0.000, Loss increases: 1]\n",
      "1600 [D loss: 1.773509, acc.: 50.00%] [G loss: 0.043467] [Loss change: 0.002, Loss increases: 0]\n",
      "1700 [D loss: 1.775174, acc.: 50.00%] [G loss: 0.045367] [Loss change: 0.000, Loss increases: 1]\n",
      "Stoping on iteration:  1793\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 15.  0.  0.  0.  0.  0.  0.  0.  0.  9.  0.  0.  1.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 23.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: normal.     number predicted:  83\n",
      "Attack type: smurf.     number predicted:  173\n",
      "\n",
      "[[  0   0   0]\n",
      " [ 83   0 173]\n",
      " [  0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[ 10   1  52   5   3   0   0   0   0   1   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   0   0   1   0 167   0   0  99   0\n",
      "    0   2   0  96   0   0]\n",
      " [  0   1  46   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 167   0   0  99   0\n",
      "    0   8   0  89   7   0]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 [D loss: 0.373484, acc.: 50.00%] [G loss: 0.605127] [Loss change: 0.605, Loss increases: 0]\n",
      "100 [D loss: 0.573504, acc.: 50.20%] [G loss: 0.413595] [Loss change: -0.001, Loss increases: 1]\n",
      "200 [D loss: 0.625658, acc.: 50.00%] [G loss: 0.364601] [Loss change: 0.003, Loss increases: 0]\n",
      "300 [D loss: 0.670457, acc.: 50.00%] [G loss: 0.357418] [Loss change: -0.005, Loss increases: 1]\n",
      "400 [D loss: 0.641362, acc.: 50.00%] [G loss: 0.372586] [Loss change: 0.022, Loss increases: 0]\n",
      "500 [D loss: 0.605573, acc.: 50.20%] [G loss: 0.374549] [Loss change: 0.002, Loss increases: 0]\n",
      "600 [D loss: 0.622949, acc.: 50.39%] [G loss: 0.377986] [Loss change: -0.009, Loss increases: 1]\n",
      "700 [D loss: 0.608687, acc.: 50.20%] [G loss: 0.390322] [Loss change: 0.004, Loss increases: 0]\n",
      "800 [D loss: 0.594598, acc.: 50.00%] [G loss: 0.404893] [Loss change: -0.003, Loss increases: 1]\n",
      "900 [D loss: 0.579201, acc.: 50.20%] [G loss: 0.411353] [Loss change: -0.004, Loss increases: 1]\n",
      "1000 [D loss: 0.559676, acc.: 50.00%] [G loss: 0.422580] [Loss change: -0.001, Loss increases: 0]\n",
      "1100 [D loss: 0.555283, acc.: 50.00%] [G loss: 0.429890] [Loss change: -0.003, Loss increases: 0]\n",
      "1200 [D loss: 0.550825, acc.: 50.20%] [G loss: 0.442941] [Loss change: 0.004, Loss increases: 0]\n",
      "Stoping on iteration:  1264\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  0. 17.  0.  0.  0.  0.  0.  0.  6.  0.  0.\n",
      "   0.  0.  0.  0. 12.  0.  0.  0.  0.  0. 12.  0.  0. 15.  0.  0. 11.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  3.  0.  0.  0.  0.  0.  7.  0. 11.  0.  0. 18.  0. 17.  0.  0.  0.\n",
      "  15.  5.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  7.  0. 16.\n",
      "  14.  0.  0.  0.  0.]]\n",
      "Attack type: land.     number predicted:  8\n",
      "Attack type: nmap.     number predicted:  39\n",
      "Attack type: normal.     number predicted:  128\n",
      "Attack type: teardrop.     number predicted:  81\n",
      "\n",
      "[[  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [  0   0   0   0   0]\n",
      " [  8  39 128   0  81]\n",
      " [  0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 503   0   0   0   1   1   0   1   0 173   0   0  99   0\n",
      "    0   0   0 100   8   0]\n",
      " [  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 503   0   0   0   1   1   0   1   0 173   0   0  99   0\n",
      "    0  31   0  69   8   0]]\n",
      "0 [D loss: 0.512054, acc.: 50.59%] [G loss: 0.614871] [Loss change: 0.615, Loss increases: 0]\n",
      "100 [D loss: 0.562540, acc.: 50.39%] [G loss: 0.420208] [Loss change: 0.001, Loss increases: 0]\n",
      "200 [D loss: 0.616462, acc.: 50.39%] [G loss: 0.387076] [Loss change: 0.017, Loss increases: 0]\n",
      "300 [D loss: 0.638049, acc.: 50.00%] [G loss: 0.366738] [Loss change: -0.007, Loss increases: 1]\n",
      "400 [D loss: 0.628969, acc.: 50.39%] [G loss: 0.364837] [Loss change: -0.005, Loss increases: 2]\n",
      "500 [D loss: 0.633844, acc.: 50.00%] [G loss: 0.357902] [Loss change: -0.006, Loss increases: 1]\n",
      "600 [D loss: 0.653836, acc.: 50.00%] [G loss: 0.358862] [Loss change: 0.005, Loss increases: 0]\n",
      "700 [D loss: 0.650014, acc.: 50.00%] [G loss: 0.358996] [Loss change: -0.002, Loss increases: 0]\n",
      "800 [D loss: 0.642972, acc.: 50.00%] [G loss: 0.359813] [Loss change: -0.011, Loss increases: 1]\n",
      "900 [D loss: 0.640013, acc.: 50.00%] [G loss: 0.365149] [Loss change: -0.002, Loss increases: 1]\n",
      "1000 [D loss: 0.609902, acc.: 50.39%] [G loss: 0.378921] [Loss change: 0.003, Loss increases: 0]\n",
      "1100 [D loss: 0.582970, acc.: 50.39%] [G loss: 0.397537] [Loss change: 0.013, Loss increases: 0]\n",
      "1200 [D loss: 0.576338, acc.: 50.39%] [G loss: 0.402311] [Loss change: 0.002, Loss increases: 1]\n",
      "1300 [D loss: 0.587646, acc.: 50.00%] [G loss: 0.409801] [Loss change: -0.002, Loss increases: 1]\n",
      "1400 [D loss: 0.558316, acc.: 51.17%] [G loss: 0.427089] [Loss change: 0.002, Loss increases: 1]\n",
      "1500 [D loss: 0.535730, acc.: 51.37%] [G loss: 0.438567] [Loss change: 0.003, Loss increases: 0]\n",
      "1600 [D loss: 0.534688, acc.: 50.20%] [G loss: 0.447736] [Loss change: -0.002, Loss increases: 1]\n",
      "1700 [D loss: 0.521149, acc.: 50.59%] [G loss: 0.464108] [Loss change: -0.007, Loss increases: 1]\n",
      "1800 [D loss: 0.495524, acc.: 52.15%] [G loss: 0.482920] [Loss change: 0.002, Loss increases: 1]\n",
      "1900 [D loss: 0.484701, acc.: 51.56%] [G loss: 0.497009] [Loss change: -0.000, Loss increases: 2]\n",
      "2000 [D loss: 0.475767, acc.: 51.95%] [G loss: 0.518822] [Loss change: 0.006, Loss increases: 0]\n",
      "2100 [D loss: 0.472189, acc.: 52.34%] [G loss: 0.524084] [Loss change: -0.004, Loss increases: 2]\n",
      "2200 [D loss: 0.484286, acc.: 53.12%] [G loss: 0.523584] [Loss change: -0.007, Loss increases: 1]\n",
      "2300 [D loss: 0.460047, acc.: 54.49%] [G loss: 0.543233] [Loss change: 0.008, Loss increases: 0]\n",
      "2400 [D loss: 0.466646, acc.: 55.47%] [G loss: 0.552283] [Loss change: -0.007, Loss increases: 2]\n",
      "2500 [D loss: 0.480060, acc.: 55.86%] [G loss: 0.533776] [Loss change: -0.004, Loss increases: 0]\n",
      "2600 [D loss: 0.460777, acc.: 58.59%] [G loss: 0.554743] [Loss change: 0.009, Loss increases: 0]\n",
      "2700 [D loss: 0.480693, acc.: 59.57%] [G loss: 0.538258] [Loss change: 0.002, Loss increases: 1]\n",
      "2800 [D loss: 0.489588, acc.: 56.45%] [G loss: 0.534980] [Loss change: 0.005, Loss increases: 0]\n",
      "2900 [D loss: 0.478040, acc.: 57.42%] [G loss: 0.531232] [Loss change: -0.004, Loss increases: 0]\n",
      "3000 [D loss: 0.485419, acc.: 58.59%] [G loss: 0.533821] [Loss change: 0.004, Loss increases: 0]\n",
      "3100 [D loss: 0.457730, acc.: 61.91%] [G loss: 0.562713] [Loss change: 0.001, Loss increases: 0]\n",
      "3200 [D loss: 0.455396, acc.: 62.30%] [G loss: 0.580557] [Loss change: 0.009, Loss increases: 0]\n",
      "3300 [D loss: 0.461474, acc.: 67.77%] [G loss: 0.563665] [Loss change: -0.001, Loss increases: 1]\n",
      "3400 [D loss: 0.472589, acc.: 64.26%] [G loss: 0.581650] [Loss change: -0.001, Loss increases: 0]\n",
      "3500 [D loss: 0.452446, acc.: 64.65%] [G loss: 0.586803] [Loss change: 0.001, Loss increases: 1]\n",
      "3600 [D loss: 0.457952, acc.: 64.84%] [G loss: 0.579852] [Loss change: 0.001, Loss increases: 0]\n",
      "3700 [D loss: 0.454496, acc.: 64.65%] [G loss: 0.605958] [Loss change: 0.015, Loss increases: 0]\n",
      "3800 [D loss: 0.431590, acc.: 68.75%] [G loss: 0.615801] [Loss change: -0.002, Loss increases: 1]\n",
      "3900 [D loss: 0.434199, acc.: 66.41%] [G loss: 0.637929] [Loss change: 0.009, Loss increases: 1]\n",
      "4000 [D loss: 0.456068, acc.: 59.57%] [G loss: 0.619129] [Loss change: -0.021, Loss increases: 0]\n",
      "Stoping on iteration:  4070\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0. 29.  0.  0.  0.  0.  0.  0.  5.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 45.  0.  0.  0.  2.  0.  0.  0.  0. 12. 26.  1.  0.  0.\n",
      "   0.  0.  0.  0. 14.]\n",
      " [ 0.  0.  0.  0. 19.  0.  0.  0.  0.  0.  0.  3.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 36.  0.  0.  0.  0.  0.  0.  0.  0. 17. 18.  0.  0.  0.\n",
      "   0.  0.  0.  1.  8.]]\n",
      "Attack type: ipsweep.     number predicted:  5\n",
      "Attack type: land.     number predicted:  1\n",
      "Attack type: neptune.     number predicted:  68\n",
      "Attack type: normal.     number predicted:  106\n",
      "Attack type: smurf.     number predicted:  76\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  5   1  68 106   0  76]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 495   0   0   0   1   1   0   1   0 168   0   0  99   0\n",
      "    0   4   0  96   8   0]\n",
      " [  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 497   0   0   0   1   1   0   1   0 168   0   0  99   0\n",
      "    0   7   0  93   8   0]]\n",
      "0 [D loss: 0.387658, acc.: 76.17%] [G loss: 0.697564] [Loss change: 0.698, Loss increases: 0]\n",
      "100 [D loss: 0.516085, acc.: 51.37%] [G loss: 0.484309] [Loss change: -0.002, Loss increases: 1]\n",
      "200 [D loss: 0.541284, acc.: 51.37%] [G loss: 0.460383] [Loss change: 0.010, Loss increases: 0]\n",
      "300 [D loss: 0.554613, acc.: 50.59%] [G loss: 0.441286] [Loss change: 0.001, Loss increases: 1]\n",
      "400 [D loss: 0.548713, acc.: 50.39%] [G loss: 0.443900] [Loss change: -0.001, Loss increases: 1]\n",
      "500 [D loss: 0.551997, acc.: 51.17%] [G loss: 0.451787] [Loss change: 0.004, Loss increases: 2]\n",
      "600 [D loss: 0.531891, acc.: 51.56%] [G loss: 0.449618] [Loss change: 0.001, Loss increases: 2]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "700 [D loss: 0.557574, acc.: 51.56%] [G loss: 0.442168] [Loss change: -0.003, Loss increases: 2]\n",
      "800 [D loss: 0.573001, acc.: 51.17%] [G loss: 0.432354] [Loss change: -0.001, Loss increases: 1]\n",
      "900 [D loss: 0.549956, acc.: 51.56%] [G loss: 0.440843] [Loss change: 0.010, Loss increases: 0]\n",
      "1000 [D loss: 0.549608, acc.: 50.59%] [G loss: 0.437821] [Loss change: -0.005, Loss increases: 0]\n",
      "1100 [D loss: 0.556765, acc.: 50.98%] [G loss: 0.441623] [Loss change: 0.003, Loss increases: 0]\n",
      "1200 [D loss: 0.547115, acc.: 50.59%] [G loss: 0.449262] [Loss change: 0.003, Loss increases: 0]\n",
      "Stoping on iteration:  1247\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0. 14.  4.  0.  0.  9.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  7.  0.  0.  0.  0.  0.  0. 18.  0.  0.  0.  0.  6.  9.\n",
      "   0.  0. 16.  7.  0.]\n",
      " [ 0.  0.  0. 12.  3.  0.  0.  8.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  6.  0.  0.  0.  0.  0.  0. 16.  0.  0.  0.  0.  5.  8.\n",
      "   0.  0. 14.  7.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  10\n",
      "Attack type: land.     number predicted:  3\n",
      "Attack type: neptune.     number predicted:  78\n",
      "Attack type: normal.     number predicted:  134\n",
      "Attack type: smurf.     number predicted:  31\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [ 10   3  78 134   0  31]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  42   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 174   0   0  99   0\n",
      "    0   0   0 100   8   0]\n",
      " [  0   1  47   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 502   0   0   0   1   1   0   1   0 174   0   0  99   0\n",
      "    0   4   0  96   8   0]]\n",
      "0 [D loss: 1.883537, acc.: 46.29%] [G loss: 0.781955] [Loss change: 0.782, Loss increases: 0]\n",
      "100 [D loss: 0.700776, acc.: 50.00%] [G loss: 0.318652] [Loss change: -0.008, Loss increases: 0]\n",
      "200 [D loss: 1.085721, acc.: 50.00%] [G loss: 0.161050] [Loss change: -0.001, Loss increases: 0]\n",
      "300 [D loss: 1.336443, acc.: 50.00%] [G loss: 0.112593] [Loss change: -0.003, Loss increases: 0]\n",
      "400 [D loss: 1.468410, acc.: 50.00%] [G loss: 0.077915] [Loss change: -0.002, Loss increases: 0]\n",
      "500 [D loss: 1.461191, acc.: 50.00%] [G loss: 0.071427] [Loss change: -0.005, Loss increases: 1]\n",
      "600 [D loss: 1.451762, acc.: 50.00%] [G loss: 0.068003] [Loss change: 0.003, Loss increases: 0]\n",
      "700 [D loss: 1.419420, acc.: 50.00%] [G loss: 0.070877] [Loss change: -0.002, Loss increases: 1]\n",
      "800 [D loss: 1.414686, acc.: 49.80%] [G loss: 0.071182] [Loss change: -0.001, Loss increases: 0]\n",
      "900 [D loss: 1.399668, acc.: 50.00%] [G loss: 0.078966] [Loss change: 0.002, Loss increases: 1]\n",
      "1000 [D loss: 1.365648, acc.: 50.00%] [G loss: 0.079320] [Loss change: 0.001, Loss increases: 2]\n",
      "1100 [D loss: 1.337368, acc.: 50.00%] [G loss: 0.077754] [Loss change: -0.003, Loss increases: 0]\n",
      "1200 [D loss: 1.325596, acc.: 50.00%] [G loss: 0.081628] [Loss change: -0.003, Loss increases: 1]\n",
      "1300 [D loss: 1.317990, acc.: 50.00%] [G loss: 0.094836] [Loss change: 0.007, Loss increases: 1]\n",
      "1400 [D loss: 1.299655, acc.: 50.00%] [G loss: 0.092438] [Loss change: 0.002, Loss increases: 0]\n",
      "1500 [D loss: 1.269281, acc.: 50.00%] [G loss: 0.095759] [Loss change: 0.001, Loss increases: 0]\n",
      "1600 [D loss: 1.245850, acc.: 50.00%] [G loss: 0.098062] [Loss change: -0.003, Loss increases: 0]\n",
      "1700 [D loss: 1.221185, acc.: 50.00%] [G loss: 0.101937] [Loss change: 0.001, Loss increases: 0]\n",
      "1800 [D loss: 1.196582, acc.: 50.00%] [G loss: 0.107983] [Loss change: 0.002, Loss increases: 0]\n",
      "1900 [D loss: 1.201956, acc.: 50.00%] [G loss: 0.109422] [Loss change: -0.001, Loss increases: 1]\n",
      "2000 [D loss: 1.172261, acc.: 50.00%] [G loss: 0.117025] [Loss change: 0.004, Loss increases: 1]\n",
      "2100 [D loss: 1.262579, acc.: 50.00%] [G loss: 0.108011] [Loss change: 0.004, Loss increases: 0]\n",
      "2200 [D loss: 1.245907, acc.: 50.00%] [G loss: 0.112004] [Loss change: 0.004, Loss increases: 2]\n",
      "2300 [D loss: 1.241853, acc.: 50.00%] [G loss: 0.115714] [Loss change: -0.001, Loss increases: 4]\n",
      "2400 [D loss: 1.222538, acc.: 50.00%] [G loss: 0.124014] [Loss change: 0.002, Loss increases: 0]\n",
      "2500 [D loss: 1.215719, acc.: 49.80%] [G loss: 0.130417] [Loss change: 0.002, Loss increases: 0]\n",
      "2600 [D loss: 1.176880, acc.: 50.00%] [G loss: 0.135211] [Loss change: 0.001, Loss increases: 1]\n",
      "2700 [D loss: 1.196037, acc.: 49.80%] [G loss: 0.136207] [Loss change: -0.007, Loss increases: 5]\n",
      "2800 [D loss: 1.210741, acc.: 49.80%] [G loss: 0.147521] [Loss change: 0.005, Loss increases: 0]\n",
      "2900 [D loss: 1.191832, acc.: 49.61%] [G loss: 0.153019] [Loss change: 0.004, Loss increases: 2]\n",
      "3000 [D loss: 1.160875, acc.: 50.00%] [G loss: 0.154031] [Loss change: -0.001, Loss increases: 0]\n",
      "3100 [D loss: 1.131578, acc.: 49.80%] [G loss: 0.159987] [Loss change: -0.001, Loss increases: 0]\n",
      "3200 [D loss: 1.130587, acc.: 49.80%] [G loss: 0.166565] [Loss change: -0.010, Loss increases: 2]\n",
      "3300 [D loss: 1.139272, acc.: 49.61%] [G loss: 0.173897] [Loss change: -0.003, Loss increases: 1]\n",
      "3400 [D loss: 1.125021, acc.: 49.61%] [G loss: 0.184823] [Loss change: -0.000, Loss increases: 1]\n",
      "3500 [D loss: 1.075552, acc.: 49.80%] [G loss: 0.184666] [Loss change: -0.008, Loss increases: 1]\n",
      "3600 [D loss: 1.095056, acc.: 49.61%] [G loss: 0.190564] [Loss change: -0.012, Loss increases: 1]\n",
      "3700 [D loss: 1.026959, acc.: 49.61%] [G loss: 0.194109] [Loss change: -0.005, Loss increases: 0]\n",
      "3800 [D loss: 1.027113, acc.: 49.61%] [G loss: 0.205978] [Loss change: -0.000, Loss increases: 0]\n",
      "3900 [D loss: 1.038947, acc.: 49.80%] [G loss: 0.197792] [Loss change: -0.010, Loss increases: 1]\n",
      "4000 [D loss: 1.025269, acc.: 49.02%] [G loss: 0.207895] [Loss change: -0.012, Loss increases: 0]\n",
      "4100 [D loss: 0.988844, acc.: 49.80%] [G loss: 0.218450] [Loss change: -0.008, Loss increases: 2]\n",
      "4200 [D loss: 0.997629, acc.: 49.41%] [G loss: 0.222349] [Loss change: 0.004, Loss increases: 0]\n",
      "4300 [D loss: 0.960705, acc.: 49.61%] [G loss: 0.236882] [Loss change: 0.007, Loss increases: 1]\n",
      "4400 [D loss: 0.973679, acc.: 49.41%] [G loss: 0.224583] [Loss change: -0.017, Loss increases: 1]\n",
      "4500 [D loss: 0.949768, acc.: 49.41%] [G loss: 0.232424] [Loss change: -0.009, Loss increases: 0]\n",
      "4600 [D loss: 0.973840, acc.: 49.41%] [G loss: 0.247856] [Loss change: -0.006, Loss increases: 2]\n",
      "4700 [D loss: 0.949028, acc.: 49.61%] [G loss: 0.248379] [Loss change: 0.000, Loss increases: 0]\n",
      "4800 [D loss: 0.989858, acc.: 48.44%] [G loss: 0.268248] [Loss change: 0.019, Loss increases: 0]\n",
      "4900 [D loss: 0.968468, acc.: 49.61%] [G loss: 0.263852] [Loss change: 0.007, Loss increases: 0]\n",
      "5000 [D loss: 0.937789, acc.: 50.20%] [G loss: 0.286054] [Loss change: 0.003, Loss increases: 0]\n",
      "5100 [D loss: 0.907073, acc.: 50.00%] [G loss: 0.310036] [Loss change: 0.013, Loss increases: 0]\n",
      "5200 [D loss: 0.858200, acc.: 50.20%] [G loss: 0.323118] [Loss change: -0.000, Loss increases: 0]\n",
      "5300 [D loss: 0.933108, acc.: 50.20%] [G loss: 0.305702] [Loss change: -0.050, Loss increases: 2]\n",
      "5400 [D loss: 0.921703, acc.: 49.61%] [G loss: 0.349716] [Loss change: -0.002, Loss increases: 2]\n",
      "5500 [D loss: 0.883575, acc.: 50.59%] [G loss: 0.351712] [Loss change: 0.002, Loss increases: 1]\n",
      "5600 [D loss: 0.888438, acc.: 49.80%] [G loss: 0.356282] [Loss change: -0.012, Loss increases: 2]\n",
      "5700 [D loss: 0.887766, acc.: 48.83%] [G loss: 0.356819] [Loss change: -0.013, Loss increases: 0]\n",
      "5800 [D loss: 0.833053, acc.: 49.61%] [G loss: 0.389044] [Loss change: -0.003, Loss increases: 1]\n",
      "5900 [D loss: 0.849259, acc.: 50.98%] [G loss: 0.385656] [Loss change: -0.028, Loss increases: 3]\n",
      "6000 [D loss: 0.805551, acc.: 50.20%] [G loss: 0.397465] [Loss change: 0.022, Loss increases: 0]\n",
      "6100 [D loss: 0.796040, acc.: 49.22%] [G loss: 0.392767] [Loss change: -0.009, Loss increases: 0]\n",
      "6200 [D loss: 0.830536, acc.: 48.63%] [G loss: 0.407303] [Loss change: 0.009, Loss increases: 0]\n",
      "6300 [D loss: 0.766875, acc.: 49.22%] [G loss: 0.455744] [Loss change: 0.021, Loss increases: 1]\n",
      "6400 [D loss: 0.817304, acc.: 50.98%] [G loss: 0.460713] [Loss change: 0.017, Loss increases: 0]\n",
      "6500 [D loss: 0.757562, acc.: 51.37%] [G loss: 0.480898] [Loss change: 0.024, Loss increases: 0]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6600 [D loss: 0.756086, acc.: 51.37%] [G loss: 0.467150] [Loss change: -0.012, Loss increases: 0]\n",
      "6700 [D loss: 0.734689, acc.: 51.76%] [G loss: 0.494709] [Loss change: -0.011, Loss increases: 1]\n",
      "6800 [D loss: 0.710014, acc.: 50.78%] [G loss: 0.551053] [Loss change: 0.016, Loss increases: 0]\n",
      "6900 [D loss: 0.671458, acc.: 51.37%] [G loss: 0.539143] [Loss change: 0.005, Loss increases: 0]\n",
      "Generated Satan attacks: \n",
      "[[  0.   0.  34.   0.   0.  32.   0.   0.   0.   0.   0.   0.   3.   0.\n",
      "    0.   0.   0.   0.   0.   0.   0.   0.   0.   3.   0.   0.   0.   0.\n",
      "    0.  27.   6.   0.   0.  63.   0.   0.   0.   0.   0.  26.   0.]\n",
      " [  0.   0.   9.   0.  37.   6.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.\n",
      "    0.   0.   0. 117.   0.   0.   7.  19.   0.   0.   0.   3.   0.]]\n",
      "Attack type: ipsweep.     number predicted:  2\n",
      "Attack type: neptune.     number predicted:  45\n",
      "Attack type: normal.     number predicted:  118\n",
      "Attack type: portsweep.     number predicted:  17\n",
      "Attack type: smurf.     number predicted:  33\n",
      "Attack type: teardrop.     number predicted:  17\n",
      "Attack type: warezclient.     number predicted:  24\n",
      "\n",
      "[[  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  2  45 118  17   0  33  17  24]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   2   0  98   8   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 504   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   2   0  98   8   0]]\n",
      "0 [D loss: 0.355421, acc.: 65.04%] [G loss: 0.607815] [Loss change: 0.608, Loss increases: 0]\n",
      "100 [D loss: 0.649540, acc.: 50.00%] [G loss: 0.359922] [Loss change: 0.007, Loss increases: 0]\n",
      "200 [D loss: 0.687775, acc.: 50.00%] [G loss: 0.336087] [Loss change: -0.000, Loss increases: 1]\n",
      "300 [D loss: 0.702199, acc.: 50.00%] [G loss: 0.325576] [Loss change: -0.005, Loss increases: 1]\n",
      "400 [D loss: 0.719096, acc.: 50.00%] [G loss: 0.320127] [Loss change: 0.005, Loss increases: 0]\n",
      "500 [D loss: 0.687591, acc.: 50.20%] [G loss: 0.328188] [Loss change: 0.006, Loss increases: 0]\n",
      "600 [D loss: 0.686789, acc.: 50.00%] [G loss: 0.334101] [Loss change: -0.003, Loss increases: 1]\n",
      "700 [D loss: 0.645620, acc.: 50.00%] [G loss: 0.349002] [Loss change: 0.002, Loss increases: 1]\n",
      "800 [D loss: 0.639070, acc.: 50.39%] [G loss: 0.358740] [Loss change: 0.006, Loss increases: 0]\n",
      "900 [D loss: 0.618469, acc.: 50.00%] [G loss: 0.368753] [Loss change: 0.001, Loss increases: 1]\n",
      "1000 [D loss: 0.623132, acc.: 50.20%] [G loss: 0.373989] [Loss change: 0.011, Loss increases: 1]\n",
      "1100 [D loss: 0.653843, acc.: 50.39%] [G loss: 0.368777] [Loss change: 0.006, Loss increases: 0]\n",
      "1200 [D loss: 0.644982, acc.: 50.20%] [G loss: 0.370256] [Loss change: -0.005, Loss increases: 0]\n",
      "1300 [D loss: 0.638962, acc.: 50.00%] [G loss: 0.356611] [Loss change: -0.000, Loss increases: 0]\n",
      "1400 [D loss: 0.622772, acc.: 50.00%] [G loss: 0.370696] [Loss change: -0.005, Loss increases: 3]\n",
      "1500 [D loss: 0.613780, acc.: 50.00%] [G loss: 0.373432] [Loss change: 0.006, Loss increases: 0]\n",
      "1600 [D loss: 0.606193, acc.: 50.00%] [G loss: 0.377288] [Loss change: 0.002, Loss increases: 0]\n",
      "1700 [D loss: 0.618579, acc.: 50.00%] [G loss: 0.383638] [Loss change: 0.005, Loss increases: 0]\n",
      "1800 [D loss: 0.613092, acc.: 50.00%] [G loss: 0.390949] [Loss change: -0.004, Loss increases: 1]\n",
      "1900 [D loss: 0.592943, acc.: 49.80%] [G loss: 0.404766] [Loss change: 0.005, Loss increases: 0]\n",
      "2000 [D loss: 0.578943, acc.: 50.00%] [G loss: 0.425217] [Loss change: 0.000, Loss increases: 2]\n",
      "2100 [D loss: 0.559091, acc.: 49.61%] [G loss: 0.444096] [Loss change: -0.001, Loss increases: 0]\n",
      "2200 [D loss: 0.556370, acc.: 50.00%] [G loss: 0.447124] [Loss change: -0.009, Loss increases: 1]\n",
      "2300 [D loss: 0.526350, acc.: 50.00%] [G loss: 0.471600] [Loss change: 0.003, Loss increases: 0]\n",
      "2400 [D loss: 0.517254, acc.: 50.00%] [G loss: 0.479052] [Loss change: -0.000, Loss increases: 0]\n",
      "Stoping on iteration:  2423\n",
      "Generated Satan attacks: \n",
      "[[ 0. 28.  0.  0.  0.  0.  0.  0. 19.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0. 18.  0.  0.  0.  0.  0.  0.  0. 28. 18.  0.  0.  0. 34.  0.\n",
      "   6. 43.  0.  1.  6.]\n",
      " [ 2.  0. 20. 18.  0. 14.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 20.  0.  0.  0.  0.  0.  2.  0.  0. 51. 15.  3.  0.  6.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  47\n",
      "Attack type: land.     number predicted:  23\n",
      "Attack type: neptune.     number predicted:  6\n",
      "Attack type: nmap.     number predicted:  87\n",
      "Attack type: normal.     number predicted:  3\n",
      "Attack type: portsweep.     number predicted:  29\n",
      "Attack type: teardrop.     number predicted:  61\n",
      "\n",
      "[[ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0]\n",
      " [47 23  6 87  3 29  0 61]\n",
      " [ 0  0  0  0  0  0  0  0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   5   0  95   8   0]\n",
      " [  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   0   0 100   8   0]]\n",
      "0 [D loss: 8.025591, acc.: 39.84%] [G loss: 0.795631] [Loss change: 0.796, Loss increases: 0]\n",
      "100 [D loss: 0.711022, acc.: 50.00%] [G loss: 0.306707] [Loss change: 0.003, Loss increases: 0]\n",
      "200 [D loss: 1.053427, acc.: 50.00%] [G loss: 0.158164] [Loss change: -0.002, Loss increases: 0]\n",
      "300 [D loss: 1.329703, acc.: 50.00%] [G loss: 0.095335] [Loss change: 0.006, Loss increases: 0]\n",
      "400 [D loss: 1.460398, acc.: 50.00%] [G loss: 0.066578] [Loss change: -0.004, Loss increases: 0]\n",
      "500 [D loss: 1.525882, acc.: 49.80%] [G loss: 0.061985] [Loss change: -0.000, Loss increases: 2]\n",
      "600 [D loss: 1.500274, acc.: 50.00%] [G loss: 0.063455] [Loss change: 0.000, Loss increases: 2]\n",
      "700 [D loss: 1.450874, acc.: 50.00%] [G loss: 0.064590] [Loss change: -0.006, Loss increases: 3]\n",
      "800 [D loss: 1.422430, acc.: 50.00%] [G loss: 0.063859] [Loss change: -0.007, Loss increases: 1]\n",
      "900 [D loss: 1.421188, acc.: 50.00%] [G loss: 0.071098] [Loss change: 0.005, Loss increases: 0]\n",
      "1000 [D loss: 1.402575, acc.: 50.00%] [G loss: 0.072273] [Loss change: 0.002, Loss increases: 0]\n",
      "1100 [D loss: 1.381200, acc.: 50.00%] [G loss: 0.075801] [Loss change: 0.006, Loss increases: 0]\n",
      "1200 [D loss: 1.366099, acc.: 50.00%] [G loss: 0.078520] [Loss change: -0.001, Loss increases: 1]\n",
      "1300 [D loss: 1.329078, acc.: 50.00%] [G loss: 0.077878] [Loss change: -0.002, Loss increases: 0]\n",
      "1400 [D loss: 1.331442, acc.: 50.00%] [G loss: 0.080656] [Loss change: -0.001, Loss increases: 1]\n",
      "1500 [D loss: 1.297902, acc.: 50.00%] [G loss: 0.086563] [Loss change: 0.003, Loss increases: 0]\n",
      "1600 [D loss: 1.286445, acc.: 50.00%] [G loss: 0.086625] [Loss change: -0.006, Loss increases: 1]\n",
      "1700 [D loss: 1.270787, acc.: 50.00%] [G loss: 0.094209] [Loss change: 0.005, Loss increases: 1]\n",
      "1800 [D loss: 1.319121, acc.: 50.00%] [G loss: 0.089852] [Loss change: -0.001, Loss increases: 1]\n",
      "1900 [D loss: 1.255764, acc.: 50.00%] [G loss: 0.100741] [Loss change: -0.004, Loss increases: 3]\n",
      "2000 [D loss: 1.241876, acc.: 50.00%] [G loss: 0.104876] [Loss change: 0.001, Loss increases: 1]\n",
      "Stoping on iteration:  2080\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 45.  0.  0.  0.  0.  0.  0.  0.  0.  9.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.]\n",
      " [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0. 45.  0.  0.  0.  0.  0.  0.  0.  0.  9.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0.]]\n",
      "Attack type: satan.     number predicted:  8\n",
      "Attack type: smurf.     number predicted:  129\n",
      "Attack type: teardrop.     number predicted:  119\n",
      "\n",
      "[[  8 129 119]\n",
      " [  0   0   0]\n",
      " [  0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.03125\n",
      "Real satan attacks:\n",
      "[[  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 506   0   0   0   1   1   0   1   0 173   0   0  99   0\n",
      "    0  12   0  88   8   0]\n",
      " [  0   1  41   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 505   0   0   0   1   1   0   1   0 173   0   0  99   0\n",
      "    0  10   0  90   8   0]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 [D loss: 0.394791, acc.: 50.00%] [G loss: 0.393754] [Loss change: 0.394, Loss increases: 0]\n",
      "100 [D loss: 0.924279, acc.: 50.00%] [G loss: 0.218678] [Loss change: 0.001, Loss increases: 0]\n",
      "200 [D loss: 0.982786, acc.: 50.00%] [G loss: 0.196305] [Loss change: 0.001, Loss increases: 0]\n",
      "300 [D loss: 0.947202, acc.: 50.00%] [G loss: 0.189964] [Loss change: -0.012, Loss increases: 1]\n",
      "400 [D loss: 0.943951, acc.: 50.00%] [G loss: 0.193708] [Loss change: 0.002, Loss increases: 0]\n",
      "500 [D loss: 0.932419, acc.: 50.00%] [G loss: 0.198330] [Loss change: 0.006, Loss increases: 0]\n",
      "600 [D loss: 0.893307, acc.: 50.00%] [G loss: 0.201599] [Loss change: 0.007, Loss increases: 0]\n",
      "700 [D loss: 0.905079, acc.: 50.00%] [G loss: 0.201467] [Loss change: 0.005, Loss increases: 0]\n",
      "800 [D loss: 0.886902, acc.: 50.00%] [G loss: 0.202439] [Loss change: -0.006, Loss increases: 1]\n",
      "900 [D loss: 0.867211, acc.: 50.00%] [G loss: 0.210810] [Loss change: 0.004, Loss increases: 0]\n",
      "1000 [D loss: 0.845239, acc.: 50.00%] [G loss: 0.220267] [Loss change: -0.002, Loss increases: 1]\n",
      "1100 [D loss: 0.838759, acc.: 50.00%] [G loss: 0.227039] [Loss change: -0.006, Loss increases: 2]\n",
      "1200 [D loss: 0.822694, acc.: 50.00%] [G loss: 0.233707] [Loss change: -0.001, Loss increases: 0]\n",
      "1300 [D loss: 0.792291, acc.: 50.00%] [G loss: 0.244728] [Loss change: -0.001, Loss increases: 1]\n",
      "1400 [D loss: 0.783536, acc.: 50.00%] [G loss: 0.247995] [Loss change: -0.001, Loss increases: 0]\n",
      "1500 [D loss: 0.766241, acc.: 50.00%] [G loss: 0.260381] [Loss change: 0.003, Loss increases: 0]\n",
      "1600 [D loss: 0.750902, acc.: 50.00%] [G loss: 0.268752] [Loss change: 0.005, Loss increases: 0]\n",
      "1700 [D loss: 0.735269, acc.: 50.00%] [G loss: 0.280591] [Loss change: 0.001, Loss increases: 0]\n",
      "1800 [D loss: 0.719458, acc.: 50.00%] [G loss: 0.290951] [Loss change: -0.000, Loss increases: 4]\n",
      "1900 [D loss: 0.694120, acc.: 50.00%] [G loss: 0.303547] [Loss change: -0.001, Loss increases: 1]\n",
      "2000 [D loss: 0.671621, acc.: 50.00%] [G loss: 0.316557] [Loss change: 0.004, Loss increases: 0]\n",
      "2100 [D loss: 0.662305, acc.: 50.00%] [G loss: 0.330715] [Loss change: 0.005, Loss increases: 1]\n",
      "2200 [D loss: 0.652764, acc.: 50.00%] [G loss: 0.338444] [Loss change: 0.003, Loss increases: 0]\n",
      "2300 [D loss: 0.628934, acc.: 50.00%] [G loss: 0.351100] [Loss change: -0.001, Loss increases: 1]\n",
      "2400 [D loss: 0.620490, acc.: 50.00%] [G loss: 0.360152] [Loss change: -0.002, Loss increases: 1]\n",
      "2500 [D loss: 0.605397, acc.: 50.00%] [G loss: 0.374934] [Loss change: 0.002, Loss increases: 1]\n",
      "2600 [D loss: 0.588536, acc.: 50.00%] [G loss: 0.389744] [Loss change: 0.001, Loss increases: 0]\n",
      "2700 [D loss: 0.571216, acc.: 50.00%] [G loss: 0.403769] [Loss change: -0.003, Loss increases: 3]\n",
      "Stoping on iteration:  2718\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0.  0.  0. 23. 40.  0.  0.  0.  0.  0.  0.  0.  0.  5.  0.  0.  1.\n",
      "   0.  0.  0.  0.  0.  4.  0.  0.  0.  9.  0.  0.  0.  2.  0.  4. 56.  0.\n",
      "   0.  0.  8.  0.  0.]\n",
      " [ 0.  0.  1.  0.  0.  0.  3.  0.  0.  0.  0.  0.  0. 40.  0. 27.  0.  4.\n",
      "   0.  0. 19. 15.  0.  0. 36. 19.  0.  0.  0.  0.  0. 13.  0.  0.  0.  6.\n",
      "   0. 14.  0.  0.  0.]]\n",
      "Attack type: land.     number predicted:  1\n",
      "Attack type: nmap.     number predicted:  115\n",
      "Attack type: normal.     number predicted:  138\n",
      "Attack type: portsweep.     number predicted:  1\n",
      "Attack type: teardrop.     number predicted:  1\n",
      "\n",
      "[[  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  0   0   0   0   0   0]\n",
      " [  1 115 138   1   0   1]\n",
      " [  0   0   0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  44   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 501   0   0   0   1   1   0   1   0 182   0   0  99   0\n",
      "    0   2   0  98   7   0]\n",
      " [  0   1  39   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 503   0   0   0   1   1   0   1   0 182   0   0  99   0\n",
      "    0   0   0 100   7   0]]\n",
      "0 [D loss: 0.602423, acc.: 67.77%] [G loss: 0.707617] [Loss change: 0.708, Loss increases: 0]\n",
      "100 [D loss: 0.547193, acc.: 50.78%] [G loss: 0.452660] [Loss change: -0.010, Loss increases: 1]\n",
      "200 [D loss: 0.658635, acc.: 50.39%] [G loss: 0.353705] [Loss change: 0.012, Loss increases: 0]\n",
      "300 [D loss: 0.842952, acc.: 50.00%] [G loss: 0.280768] [Loss change: 0.004, Loss increases: 0]\n",
      "400 [D loss: 0.839104, acc.: 50.39%] [G loss: 0.274725] [Loss change: 0.004, Loss increases: 1]\n",
      "500 [D loss: 0.886508, acc.: 50.59%] [G loss: 0.271516] [Loss change: -0.003, Loss increases: 2]\n",
      "600 [D loss: 0.808023, acc.: 50.59%] [G loss: 0.272456] [Loss change: -0.001, Loss increases: 1]\n",
      "700 [D loss: 0.840517, acc.: 51.95%] [G loss: 0.259459] [Loss change: -0.009, Loss increases: 1]\n",
      "800 [D loss: 0.839416, acc.: 51.76%] [G loss: 0.258912] [Loss change: -0.013, Loss increases: 0]\n",
      "900 [D loss: 0.848061, acc.: 52.34%] [G loss: 0.275767] [Loss change: 0.001, Loss increases: 2]\n",
      "1000 [D loss: 0.835585, acc.: 51.95%] [G loss: 0.270051] [Loss change: -0.002, Loss increases: 3]\n",
      "1100 [D loss: 0.807164, acc.: 51.95%] [G loss: 0.281909] [Loss change: 0.001, Loss increases: 0]\n",
      "1200 [D loss: 0.828546, acc.: 51.37%] [G loss: 0.271976] [Loss change: -0.002, Loss increases: 2]\n",
      "1300 [D loss: 0.775419, acc.: 51.37%] [G loss: 0.277006] [Loss change: -0.010, Loss increases: 1]\n",
      "1400 [D loss: 0.795888, acc.: 50.00%] [G loss: 0.287573] [Loss change: 0.008, Loss increases: 0]\n",
      "1500 [D loss: 0.785405, acc.: 50.00%] [G loss: 0.286475] [Loss change: 0.001, Loss increases: 0]\n",
      "1600 [D loss: 0.764099, acc.: 50.00%] [G loss: 0.284945] [Loss change: 0.000, Loss increases: 0]\n",
      "1700 [D loss: 0.726779, acc.: 50.00%] [G loss: 0.303871] [Loss change: 0.016, Loss increases: 0]\n",
      "1800 [D loss: 0.737992, acc.: 50.00%] [G loss: 0.300105] [Loss change: -0.002, Loss increases: 1]\n",
      "1900 [D loss: 0.732202, acc.: 50.00%] [G loss: 0.298198] [Loss change: -0.003, Loss increases: 0]\n",
      "2000 [D loss: 0.720410, acc.: 50.00%] [G loss: 0.305062] [Loss change: -0.005, Loss increases: 1]\n",
      "2100 [D loss: 0.718614, acc.: 50.00%] [G loss: 0.318021] [Loss change: -0.002, Loss increases: 2]\n",
      "2200 [D loss: 0.707345, acc.: 50.00%] [G loss: 0.318505] [Loss change: -0.003, Loss increases: 0]\n",
      "2300 [D loss: 0.663573, acc.: 50.00%] [G loss: 0.332577] [Loss change: -0.004, Loss increases: 1]\n",
      "2400 [D loss: 0.652466, acc.: 50.00%] [G loss: 0.348431] [Loss change: -0.004, Loss increases: 3]\n",
      "2500 [D loss: 0.643453, acc.: 50.00%] [G loss: 0.359394] [Loss change: -0.001, Loss increases: 2]\n",
      "2600 [D loss: 0.623976, acc.: 50.00%] [G loss: 0.363318] [Loss change: -0.009, Loss increases: 1]\n",
      "2700 [D loss: 0.609151, acc.: 50.00%] [G loss: 0.385007] [Loss change: 0.001, Loss increases: 2]\n",
      "2800 [D loss: 0.589541, acc.: 50.00%] [G loss: 0.399983] [Loss change: 0.003, Loss increases: 0]\n",
      "2900 [D loss: 0.580569, acc.: 50.00%] [G loss: 0.403971] [Loss change: 0.001, Loss increases: 0]\n",
      "3000 [D loss: 0.578621, acc.: 50.00%] [G loss: 0.413883] [Loss change: 0.003, Loss increases: 0]\n",
      "3100 [D loss: 0.555417, acc.: 50.39%] [G loss: 0.432336] [Loss change: 0.004, Loss increases: 3]\n",
      "3200 [D loss: 0.564636, acc.: 50.00%] [G loss: 0.424485] [Loss change: -0.004, Loss increases: 0]\n",
      "3300 [D loss: 0.548593, acc.: 50.00%] [G loss: 0.446787] [Loss change: -0.005, Loss increases: 1]\n",
      "3400 [D loss: 0.531207, acc.: 50.00%] [G loss: 0.460620] [Loss change: 0.002, Loss increases: 0]\n",
      "3500 [D loss: 0.518756, acc.: 50.00%] [G loss: 0.470002] [Loss change: 0.001, Loss increases: 0]\n",
      "3600 [D loss: 0.500367, acc.: 50.20%] [G loss: 0.487073] [Loss change: -0.003, Loss increases: 3]\n",
      "3700 [D loss: 0.495628, acc.: 50.00%] [G loss: 0.505268] [Loss change: 0.000, Loss increases: 1]\n",
      "3800 [D loss: 0.482725, acc.: 50.00%] [G loss: 0.518203] [Loss change: -0.001, Loss increases: 1]\n",
      "3900 [D loss: 0.467852, acc.: 50.00%] [G loss: 0.534687] [Loss change: 0.003, Loss increases: 1]\n",
      "4000 [D loss: 0.462232, acc.: 52.34%] [G loss: 0.550361] [Loss change: -0.005, Loss increases: 0]\n",
      "Stoping on iteration:  4094\n",
      "Generated Satan attacks: \n",
      "[[ 0.  0. 44.  0.  0. 15.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  3.  0.  0.  0.  0.  0.  7.  0.  0.  0.  7.  8. 40. 13.\n",
      "   0.  1.  0.  0.  0.]\n",
      " [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "   0.  0.  0.  0.  0. 22.  0.  0.  0.  0.  0.  0.  0. 60.  0.  0.  0.  0.\n",
      "  28.  0.  0.  0.  0.]]\n",
      "Attack type: ipsweep.     number predicted:  35\n",
      "Attack type: normal.     number predicted:  71\n",
      "Attack type: teardrop.     number predicted:  150\n",
      "\n",
      "[[  0   0   0   0]\n",
      " [  0   0   0   0]\n",
      " [ 35  71   0 150]\n",
      " [  0   0   0   0]]\n",
      "total: 256\n",
      "accuracy: 0.0\n",
      "Real satan attacks:\n",
      "[[  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0  35   0  65   8   0]\n",
      " [  0   1  40   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0\n",
      "    0   0   0   0 507   0   0   0   1   1   0   1   0 178   0   0  99   0\n",
      "    0   5   0  95   8   0]]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 [D loss: 0.362751, acc.: 64.06%] [G loss: 0.628469] [Loss change: 0.628, Loss increases: 0]\n",
      "100 [D loss: 0.550079, acc.: 50.20%] [G loss: 0.431465] [Loss change: -0.007, Loss increases: 2]\n",
      "200 [D loss: 0.594070, acc.: 50.59%] [G loss: 0.397329] [Loss change: -0.003, Loss increases: 0]\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-8-0111379057fa>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m     21\u001b[0m         \u001b[0mresult_filename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"GANresultsSatan%.0f%.0f%.0fiter%.0f.txt\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mgen_hidden1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgen_hidden2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgen_hidden3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     22\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 23\u001b[0;31m         \u001b[0mtrainGAN\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgen_hidden1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgen_hidden2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgen_hidden3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     24\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     25\u001b[0m         \u001b[0;31m# load generate attacks from file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<ipython-input-4-905551f99865>\u001b[0m in \u001b[0;36mtrainGAN\u001b[0;34m(gen_hidden1, gen_hidden2, gen_hidden3)\u001b[0m\n\u001b[1;32m     57\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     58\u001b[0m         \u001b[0;31m# create an array of generated attacks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 59\u001b[0;31m         \u001b[0mgen_attacks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnoise\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     60\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     61\u001b[0m         \u001b[0;31m# loss functions, based on what metrics we specify at model compile time\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/keras/engine/training.py\u001b[0m in \u001b[0;36mpredict\u001b[0;34m(self, x, batch_size, verbose, steps)\u001b[0m\n\u001b[1;32m   1167\u001b[0m                                             \u001b[0mbatch_size\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1168\u001b[0m                                             \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1169\u001b[0;31m                                             steps=steps)\n\u001b[0m\u001b[1;32m   1170\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1171\u001b[0m     def train_on_batch(self, x, y,\n",
      "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/keras/engine/training_arrays.py\u001b[0m in \u001b[0;36mpredict_loop\u001b[0;34m(model, f, ins, batch_size, verbose, steps)\u001b[0m\n\u001b[1;32m    292\u001b[0m                 \u001b[0mins_batch\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mins_batch\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtoarray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    293\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 294\u001b[0;31m             \u001b[0mbatch_outs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mins_batch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    295\u001b[0m             \u001b[0mbatch_outs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mto_list\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch_outs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    296\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mbatch_index\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, inputs)\u001b[0m\n\u001b[1;32m   2713\u001b[0m                 \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_legacy_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2714\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2715\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   2716\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2717\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mpy_any\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mis_tensor\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[0;32min\u001b[0m \u001b[0minputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py\u001b[0m in \u001b[0;36m_call\u001b[0;34m(self, inputs)\u001b[0m\n\u001b[1;32m   2634\u001b[0m             \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'`inputs` should be a list or tuple.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2635\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2636\u001b[0;31m         \u001b[0msession\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   2637\u001b[0m         \u001b[0mfeed_arrays\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2638\u001b[0m         \u001b[0marray_vals\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py\u001b[0m in \u001b[0;36mget_session\u001b[0;34m()\u001b[0m\n\u001b[1;32m    191\u001b[0m             \u001b[0mcandidate_vars\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    192\u001b[0m             \u001b[0;32mfor\u001b[0m \u001b[0mv\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mvariables\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 193\u001b[0;31m                 \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mv\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'_keras_initialized'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    194\u001b[0m                     \u001b[0mcandidate_vars\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mv\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    195\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0mcandidate_vars\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "\"\"\"\n",
    "f = open(\"GeneratorHypersAbove50percentAccuracy.txt\", \"w\")\n",
    "f.write(\"\"\"\"\"\" Hidden layer counts for Generator model that resulted in over 50% generated attacks labeled correctly:\n",
    "    ------------------------------------------------------------------------------------------------\n",
    "    \"\"\"\"\"\")\n",
    "f.close()\n",
    "\"\"\"\n",
    "\n",
    "while(1):\n",
    "    # generate random numbers for the hidden layer sizes of our generator\n",
    "    gen_hidden1 = np.random.randint(1, 101)\n",
    "    gen_hidden2 = np.random.randint(1, 101)\n",
    "    gen_hidden3 = np.random.randint(1, 101)\n",
    "    \n",
    "    i = 0\n",
    "    \n",
    "    \n",
    "    # train 5 times on each setup, in case we get unlucky initalization on an otherwise good setup\n",
    "    while i < 5:\n",
    "        # create a unique filename in case we want to store the results (good accuracy)\n",
    "        result_filename = \"GANresultsSatan%.0f%.0f%.0fiter%.0f.txt\" % (gen_hidden1, gen_hidden2, gen_hidden3, i)\n",
    "\n",
    "        trainGAN(gen_hidden1, gen_hidden2, gen_hidden3)\n",
    "        \n",
    "        # load generate attacks from file\n",
    "        results = np.loadtxt(\"GANresultsSatan.txt\")\n",
    "\n",
    "        # predict attack lables (as encoded integers)\n",
    "        y_pred = estimator.predict(results)\n",
    "\n",
    "        # create appropriate labels for our generated neptune attacks\n",
    "        satan_labels = np.full((len(results),), satan_index[0])\n",
    "\n",
    "        # convert integer labels back to string, get all unique strings and their count\n",
    "        predicted_as_label = attack_labels[y_pred]\n",
    "        unique_labels = np.unique(predicted_as_label)\n",
    "\n",
    "        for label in unique_labels:\n",
    "            print(\"Attack type: %s     number predicted:  %.0f\" % (label, len(np.where(predicted_as_label == label)[0])))\n",
    "    \n",
    "        print()\n",
    "        # create a confusion matrix of the results\n",
    "        cm = confusion_matrix(satan_labels, y_pred)\n",
    "        \n",
    "        accuracy = np.trace(cm) / cm.sum()\n",
    "        print(cm)\n",
    "        print(\"total: \" + str(cm.sum()))\n",
    "        print(\"accuracy: \" + str(accuracy))\n",
    "        \n",
    "        if accuracy > .50:\n",
    "            f = open(\"GeneratorHypersAbove50percentAccuracySatan.txt\", \"a\")\n",
    "            f.write(\"\"\"\n",
    "            \n",
    "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
    "Accuracy: %.3f\n",
    "Generator hidden layer 1 size: %.0f\n",
    "Generator hidden layer 2 size: %.0f\n",
    "Generator hidden layer 3 size: %.0f\n",
    "Iteration %.0f\n",
    "Result file name: %s\n",
    "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\"\" % (accuracy, gen_hidden1, gen_hidden2, gen_hidden3, i, result_filename))\n",
    "            f.close()\n",
    "            \n",
    "            f = open(result_filename, \"w\")\n",
    "            f.close()\n",
    "            np.savetxt(result_filename, results, fmt=\"%.0f\")\n",
    "        \n",
    "        i = i + 1\n",
    "            \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
